<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">{-
(c) The GRASP/AQUA Project, Glasgow University, 1992-1998

\section[SimplCore]{Driver for simplifying @Core@ programs}
-}</span><span>
</span><span id="line-6"></span><span>
</span><span id="line-7"></span><span class="hs-pragma">{-# LANGUAGE CPP #-}</span><span>
</span><span id="line-8"></span><span>
</span><span id="line-9"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.Core.Opt.Pipeline</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#core2core"><span class="hs-identifier">core2core</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#simplifyExpr"><span class="hs-identifier">simplifyExpr</span></a></span><span> </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span class="hs-cpp">

#include &quot;HsVersions.h&quot;
</span><span>
</span><span id="line-13"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-14"></span><span>
</span><span id="line-15"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-16"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.html"><span class="hs-identifier">GHC.Core</span></a></span><span>
</span><span id="line-17"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html"><span class="hs-identifier">GHC.Driver.Types</span></a></span><span>
</span><span id="line-18"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.CSE.html"><span class="hs-identifier">GHC.Core.Opt.CSE</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.CSE.html#cseProgram"><span class="hs-identifier">cseProgram</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-19"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Rules.html"><span class="hs-identifier">GHC.Core.Rules</span></a></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Rules.html#mkRuleBase"><span class="hs-identifier">mkRuleBase</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Rules.html#unionRuleBase"><span class="hs-identifier">unionRuleBase</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-20"></span><span>                          </span><span class="annot"><a href="GHC.Core.Rules.html#extendRuleBaseList"><span class="hs-identifier">extendRuleBaseList</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Rules.html#ruleCheckProgram"><span class="hs-identifier">ruleCheckProgram</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Rules.html#addRuleInfo"><span class="hs-identifier">addRuleInfo</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>                          </span><span class="annot"><a href="GHC.Core.Rules.html#getRules"><span class="hs-identifier">getRules</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Rules.html#initRuleOpts"><span class="hs-identifier">initRuleOpts</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-22"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Ppr.html"><span class="hs-identifier">GHC.Core.Ppr</span></a></span><span>     </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Ppr.html#pprCoreBindings"><span class="hs-identifier">pprCoreBindings</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Ppr.html#pprCoreExpr"><span class="hs-identifier">pprCoreExpr</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-23"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.OccurAnal.html"><span class="hs-identifier">GHC.Core.Opt.OccurAnal</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.OccurAnal.html#occurAnalysePgm"><span class="hs-identifier">occurAnalysePgm</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Opt.OccurAnal.html#occurAnalyseExpr"><span class="hs-identifier">occurAnalyseExpr</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-24"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.Info.html"><span class="hs-identifier">GHC.Types.Id.Info</span></a></span><span>
</span><span id="line-25"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Stats.html"><span class="hs-identifier">GHC.Core.Stats</span></a></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Stats.html#coreBindsSize"><span class="hs-identifier">coreBindsSize</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Stats.html#coreBindsStats"><span class="hs-identifier">coreBindsStats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Stats.html#exprSize"><span class="hs-identifier">exprSize</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Utils.html"><span class="hs-identifier">GHC.Core.Utils</span></a></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Utils.html#mkTicks"><span class="hs-identifier">mkTicks</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Utils.html#stripTicksTop"><span class="hs-identifier">stripTicksTop</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-27"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Lint.html"><span class="hs-identifier">GHC.Core.Lint</span></a></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Lint.html#endPass"><span class="hs-identifier">endPass</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Lint.html#lintPassResult"><span class="hs-identifier">lintPassResult</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Lint.html#dumpPassResult"><span class="hs-identifier">dumpPassResult</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-28"></span><span>                          </span><span class="annot"><a href="GHC.Core.Lint.html#lintAnnots"><span class="hs-identifier">lintAnnots</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Simplify.html"><span class="hs-identifier">GHC.Core.Opt.Simplify</span></a></span><span>       </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Simplify.html#simplTopBinds"><span class="hs-identifier">simplTopBinds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Simplify.html#simplExpr"><span class="hs-identifier">simplExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Simplify.html#simplRules"><span class="hs-identifier">simplRules</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Simplify.Utils.html"><span class="hs-identifier">GHC.Core.Opt.Simplify.Utils</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Simplify.Utils.html#simplEnvForGHCi"><span class="hs-identifier">simplEnvForGHCi</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Simplify.Utils.html#activeRule"><span class="hs-identifier">activeRule</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Simplify.Utils.html#activeUnfolding"><span class="hs-identifier">activeUnfolding</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Simplify.Env.html"><span class="hs-identifier">GHC.Core.Opt.Simplify.Env</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Simplify.Monad.html"><span class="hs-identifier">GHC.Core.Opt.Simplify.Monad</span></a></span><span>
</span><span id="line-33"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html"><span class="hs-identifier">GHC.Core.Opt.Monad</span></a></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html"><span class="hs-identifier">GHC.Utils.Error</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Err</span></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatIn.html"><span class="hs-identifier">GHC.Core.Opt.FloatIn</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatIn.html#floatInwards"><span class="hs-identifier">floatInwards</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html"><span class="hs-identifier">GHC.Core.Opt.FloatOut</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.FloatOut.html#floatOutwards"><span class="hs-identifier">floatOutwards</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.FamInstEnv.html"><span class="hs-identifier">GHC.Core.FamInstEnv</span></a></span><span>
</span><span id="line-38"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Id.html"><span class="hs-identifier">GHC.Types.Id</span></a></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html"><span class="hs-identifier">GHC.Utils.Error</span></a></span><span>  </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#withTiming"><span class="hs-identifier">withTiming</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#withTimingD"><span class="hs-identifier">withTimingD</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Utils.Error.html#DumpFormat"><span class="hs-identifier">DumpFormat</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">..</span><span class="hs-special">)</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html"><span class="hs-identifier">GHC.Types.Basic</span></a></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Set.html"><span class="hs-identifier">GHC.Types.Var.Set</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html"><span class="hs-identifier">GHC.Types.Var.Env</span></a></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.LiberateCase.html"><span class="hs-identifier">GHC.Core.Opt.LiberateCase</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.LiberateCase.html#liberateCase"><span class="hs-identifier">liberateCase</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-44"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.StaticArgs.html"><span class="hs-identifier">GHC.Core.Opt.StaticArgs</span></a></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.StaticArgs.html#doStaticArgs"><span class="hs-identifier">doStaticArgs</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Specialise.html"><span class="hs-identifier">GHC.Core.Opt.Specialise</span></a></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Specialise.html#specProgram"><span class="hs-identifier">specProgram</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.SpecConstr.html"><span class="hs-identifier">GHC.Core.Opt.SpecConstr</span></a></span><span>   </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.SpecConstr.html#specConstrProgram"><span class="hs-identifier">specConstrProgram</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-47"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.DmdAnal.html"><span class="hs-identifier">GHC.Core.Opt.DmdAnal</span></a></span><span>      </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.DmdAnal.html#dmdAnalProgram"><span class="hs-identifier">dmdAnalProgram</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-48"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.CprAnal.html"><span class="hs-identifier">GHC.Core.Opt.CprAnal</span></a></span><span>      </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.CprAnal.html#cprAnalProgram"><span class="hs-identifier">cprAnalProgram</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-49"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.CallArity.html"><span class="hs-identifier">GHC.Core.Opt.CallArity</span></a></span><span>    </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.CallArity.html#callArityAnalProgram"><span class="hs-identifier">callArityAnalProgram</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-50"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Exitify.html"><span class="hs-identifier">GHC.Core.Opt.Exitify</span></a></span><span>      </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Exitify.html#exitifyProgram"><span class="hs-identifier">exitifyProgram</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-51"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Core.Opt.WorkWrap.html"><span class="hs-identifier">GHC.Core.Opt.WorkWrap</span></a></span><span>     </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Core.Opt.WorkWrap.html#wwTopBinds"><span class="hs-identifier">wwTopBinds</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-52"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.SrcLoc.html"><span class="hs-identifier">GHC.Types.SrcLoc</span></a></span><span>
</span><span id="line-53"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Misc.html"><span class="hs-identifier">GHC.Utils.Misc</span></a></span><span>
</span><span id="line-54"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.Env.html"><span class="hs-identifier">GHC.Unit.Module.Env</span></a></span><span>
</span><span id="line-55"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Plugins.html"><span class="hs-identifier">GHC.Driver.Plugins</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Driver.Plugins.html#withPlugins"><span class="hs-identifier">withPlugins</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Plugins.html#installCoreToDos"><span class="hs-identifier">installCoreToDos</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-56"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Loader.html"><span class="hs-identifier">GHC.Runtime.Loader</span></a></span><span> </span><span class="hs-comment">-- ( initializePlugins )</span><span>
</span><span id="line-57"></span><span>
</span><span id="line-58"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html"><span class="hs-identifier">GHC.Types.Unique.Supply</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSupply"><span class="hs-identifier">UniqSupply</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#mkSplitUniqSupply"><span class="hs-identifier">mkSplitUniqSupply</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#splitUniqSupply"><span class="hs-identifier">splitUniqSupply</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-59"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.Unique.FM.html"><span class="hs-identifier">GHC.Types.Unique.FM</span></a></span><span>
</span><span id="line-60"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-61"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-62"></span><span class="hs-keyword">import</span><span> </span><span class="hs-keyword">qualified</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.LanguageExtensions.html#"><span class="hs-identifier">GHC.LanguageExtensions</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">LangExt</span></span><span>
</span><span id="line-63"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{The driver for the simplifier}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-70"></span><span>
</span><span id="line-71"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#core2core"><span class="hs-identifier hs-type">core2core</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span>
</span><span id="line-72"></span><span id="core2core"><span class="annot"><span class="annottext">core2core :: HscEnv -&gt; ModGuts -&gt; IO ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#core2core"><span class="hs-identifier hs-var hs-var">core2core</span></a></span></span><span> </span><span id="local-6989586621681190988"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190988"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681190987"><span class="annot"><span class="annottext">guts :: ModGuts
</span><a href="#local-6989586621681190987"><span class="hs-identifier hs-var">guts</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_module :: ModGuts -&gt; Module
</span><a href="GHC.Driver.Types.html#mg_module"><span class="hs-identifier hs-var">mg_module</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681190984"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681190984"><span class="hs-identifier hs-var">mod</span></a></span></span><span>
</span><span id="line-73"></span><span>                                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_loc :: ModGuts -&gt; SrcSpan
</span><a href="GHC.Driver.Types.html#mg_loc"><span class="hs-identifier hs-var">mg_loc</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681190982"><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681190982"><span class="hs-identifier hs-var">loc</span></a></span></span><span>
</span><span id="line-74"></span><span>                                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_deps :: ModGuts -&gt; Dependencies
</span><a href="GHC.Driver.Types.html#mg_deps"><span class="hs-identifier hs-var">mg_deps</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681190980"><span class="annot"><span class="annottext">Dependencies
</span><a href="#local-6989586621681190980"><span class="hs-identifier hs-var">deps</span></a></span></span><span>
</span><span id="line-75"></span><span>                                </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_rdr_env :: ModGuts -&gt; GlobalRdrEnv
</span><a href="GHC.Driver.Types.html#mg_rdr_env"><span class="hs-identifier hs-var">mg_rdr_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681190978"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681190978"><span class="hs-identifier hs-var">rdr_env</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-76"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-comment">-- make sure all plugins are loaded</span><span>
</span><span id="line-77"></span><span>
</span><span id="line-78"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681190977"><span class="annot"><span class="annottext">builtin_passes :: [CoreToDo]
</span><a href="#local-6989586621681190977"><span class="hs-identifier hs-var hs-var">builtin_passes</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; [CoreToDo]
</span><a href="GHC.Core.Opt.Pipeline.html#getCoreToDo"><span class="hs-identifier hs-var">getCoreToDo</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190975"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-79"></span><span>             </span><span id="local-6989586621681190974"><span class="annot"><span class="annottext">orph_mods :: ModuleSet
</span><a href="#local-6989586621681190974"><span class="hs-identifier hs-var hs-var">orph_mods</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Module] -&gt; ModuleSet
</span><a href="GHC.Unit.Module.Env.html#mkModuleSet"><span class="hs-identifier hs-var">mkModuleSet</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681190984"><span class="hs-identifier hs-var">mod</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; [Module] -&gt; [Module]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Dependencies -&gt; [Module]
</span><a href="GHC.Driver.Types.html#dep_orphs"><span class="hs-identifier hs-var hs-var">dep_orphs</span></a></span><span> </span><span class="annot"><span class="annottext">Dependencies
</span><a href="#local-6989586621681190980"><span class="hs-identifier hs-var">deps</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-80"></span><span>             </span><span id="local-6989586621681190971"><span class="annot"><span class="annottext">uniq_mask :: Char
</span><a href="#local-6989586621681190971"><span class="hs-identifier hs-var hs-var">uniq_mask</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'s'</span></span><span>
</span><span id="line-81"></span><span>       </span><span class="hs-special">;</span><span>
</span><span id="line-82"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681190970"><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190970"><span class="hs-identifier hs-var">guts2</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681190969"><span class="annot"><span class="annottext">SimplCount
</span><a href="#local-6989586621681190969"><span class="hs-identifier hs-var">stats</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv
-&gt; RuleBase
-&gt; Char
-&gt; Module
-&gt; ModuleSet
-&gt; PrintUnqualified
-&gt; SrcSpan
-&gt; CoreM ModGuts
-&gt; IO (ModGuts, SimplCount)
forall a.
HscEnv
-&gt; RuleBase
-&gt; Char
-&gt; Module
-&gt; ModuleSet
-&gt; PrintUnqualified
-&gt; SrcSpan
-&gt; CoreM a
-&gt; IO (a, SimplCount)
</span><a href="GHC.Core.Opt.Monad.html#runCoreM"><span class="hs-identifier hs-var">runCoreM</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190988"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">RuleBase
</span><a href="#local-6989586621681190967"><span class="hs-identifier hs-var">hpt_rule_base</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><a href="#local-6989586621681190971"><span class="hs-identifier hs-var">uniq_mask</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681190984"><span class="hs-identifier hs-var">mod</span></a></span><span>
</span><span id="line-83"></span><span>                                    </span><span class="annot"><span class="annottext">ModuleSet
</span><a href="#local-6989586621681190974"><span class="hs-identifier hs-var">orph_mods</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621681190966"><span class="hs-identifier hs-var">print_unqual</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="#local-6989586621681190982"><span class="hs-identifier hs-var">loc</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreM ModGuts -&gt; IO (ModGuts, SimplCount))
-&gt; CoreM ModGuts -&gt; IO (ModGuts, SimplCount)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-84"></span><span>                           </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681190965"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190965"><span class="hs-identifier hs-var">hsc_env'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreM HscEnv
</span><a href="GHC.Core.Opt.Monad.html#getHscEnv"><span class="hs-identifier hs-var">getHscEnv</span></a></span><span>
</span><span id="line-85"></span><span>                              </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681190963"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190963"><span class="hs-identifier hs-var">dflags'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO DynFlags -&gt; CoreM DynFlags
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO DynFlags -&gt; CoreM DynFlags) -&gt; IO DynFlags -&gt; CoreM DynFlags
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags -&gt; IO DynFlags
</span><a href="GHC.Runtime.Loader.html#initializePlugins"><span class="hs-identifier hs-var">initializePlugins</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190965"><span class="hs-identifier hs-var">hsc_env'</span></a></span><span>
</span><span id="line-86"></span><span>                                                      </span><span class="hs-special">(</span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190965"><span class="hs-identifier hs-var">hsc_env'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-87"></span><span>                              </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681190959"><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190959"><span class="hs-identifier hs-var">all_passes</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; PluginOperation CoreM [CoreToDo]
-&gt; [CoreToDo]
-&gt; CoreM [CoreToDo]
forall (m :: * -&gt; *) a.
Monad m =&gt;
DynFlags -&gt; PluginOperation m a -&gt; a -&gt; m a
</span><a href="GHC.Driver.Plugins.html#withPlugins"><span class="hs-identifier hs-var">withPlugins</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190963"><span class="hs-identifier hs-var">dflags'</span></a></span><span>
</span><span id="line-88"></span><span>                                                </span><span class="annot"><span class="annottext">PluginOperation CoreM [CoreToDo]
</span><a href="GHC.Driver.Plugins.html#installCoreToDos"><span class="hs-identifier hs-var hs-var">installCoreToDos</span></a></span><span>
</span><span id="line-89"></span><span>                                                </span><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190977"><span class="hs-identifier hs-var">builtin_passes</span></a></span><span>
</span><span id="line-90"></span><span>                              </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">[CoreToDo] -&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#runCorePasses"><span class="hs-identifier hs-var">runCorePasses</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190959"><span class="hs-identifier hs-var">all_passes</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190987"><span class="hs-identifier hs-var">guts</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-91"></span><span>
</span><span id="line-92"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; DumpFlag -&gt; String -&gt; DumpFormat -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet_dyn"><span class="hs-identifier hs-var">Err.dumpIfSet_dyn</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190975"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_simpl_stats"><span class="hs-identifier hs-var">Opt_D_dump_simpl_stats</span></a></span><span>
</span><span id="line-93"></span><span>             </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Grand total simplifier statistics&quot;</span></span><span>
</span><span id="line-94"></span><span>             </span><span class="annot"><span class="annottext">DumpFormat
</span><a href="GHC.Utils.Error.html#FormatText"><span class="hs-identifier hs-var">FormatText</span></a></span><span>
</span><span id="line-95"></span><span>             </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SimplCount -&gt; SDoc
</span><a href="GHC.Core.Opt.Monad.html#pprSimplCount"><span class="hs-identifier hs-var">pprSimplCount</span></a></span><span> </span><span class="annot"><span class="annottext">SimplCount
</span><a href="#local-6989586621681190969"><span class="hs-identifier hs-var">stats</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-96"></span><span>
</span><span id="line-97"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">ModGuts -&gt; IO ModGuts
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190970"><span class="hs-identifier hs-var">guts2</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-98"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-99"></span><span>    </span><span id="local-6989586621681190975"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681190975"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190988"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-100"></span><span>    </span><span id="local-6989586621681190953"><span class="annot"><span class="annottext">home_pkg_rules :: [CoreRule]
</span><a href="#local-6989586621681190953"><span class="hs-identifier hs-var hs-var">home_pkg_rules</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; [ModuleNameWithIsBoot] -&gt; [CoreRule]
</span><a href="GHC.Driver.Types.html#hptRules"><span class="hs-identifier hs-var">hptRules</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190988"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Dependencies -&gt; [ModuleNameWithIsBoot]
</span><a href="GHC.Driver.Types.html#dep_mods"><span class="hs-identifier hs-var hs-var">dep_mods</span></a></span><span> </span><span class="annot"><span class="annottext">Dependencies
</span><a href="#local-6989586621681190980"><span class="hs-identifier hs-var">deps</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-101"></span><span>    </span><span id="local-6989586621681190967"><span class="annot"><span class="annottext">hpt_rule_base :: RuleBase
</span><a href="#local-6989586621681190967"><span class="hs-identifier hs-var hs-var">hpt_rule_base</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreRule] -&gt; RuleBase
</span><a href="GHC.Core.Rules.html#mkRuleBase"><span class="hs-identifier hs-var">mkRuleBase</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681190953"><span class="hs-identifier hs-var">home_pkg_rules</span></a></span><span>
</span><span id="line-102"></span><span>    </span><span id="local-6989586621681190966"><span class="annot"><span class="annottext">print_unqual :: PrintUnqualified
</span><a href="#local-6989586621681190966"><span class="hs-identifier hs-var hs-var">print_unqual</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; GlobalRdrEnv -&gt; PrintUnqualified
</span><a href="GHC.Driver.Types.html#mkPrintUnqualified"><span class="hs-identifier hs-var">mkPrintUnqualified</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190975"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681190978"><span class="hs-identifier hs-var">rdr_env</span></a></span><span>
</span><span id="line-103"></span><span>    </span><span class="hs-comment">-- mod: get the module out of the current HscEnv so we can retrieve it from the monad.</span><span>
</span><span id="line-104"></span><span>    </span><span class="hs-comment">-- This is very convienent for the users of the monad (e.g. plugins do not have to</span><span>
</span><span id="line-105"></span><span>    </span><span class="hs-comment">-- consume the ModGuts to find the module) but somewhat ugly because mg_module may</span><span>
</span><span id="line-106"></span><span>    </span><span class="hs-comment">-- _theoretically_ be changed during the Core pipeline (it's part of ModGuts), which</span><span>
</span><span id="line-107"></span><span>    </span><span class="hs-comment">-- would mean our cached value would go out of date.</span><span>
</span><span id="line-108"></span><span>
</span><span id="line-109"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
           Generating the main optimisation pipeline
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-116"></span><span>
</span><span id="line-117"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#getCoreToDo"><span class="hs-identifier hs-type">getCoreToDo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreToDo"><span class="hs-identifier hs-type">CoreToDo</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-118"></span><span id="getCoreToDo"><span class="annot"><span class="annottext">getCoreToDo :: DynFlags -&gt; [CoreToDo]
</span><a href="GHC.Core.Opt.Pipeline.html#getCoreToDo"><span class="hs-identifier hs-var hs-var">getCoreToDo</span></a></span></span><span> </span><span id="local-6989586621681190949"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span></span><span>
</span><span id="line-119"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreToDo] -&gt; [CoreToDo]
</span><a href="#local-6989586621681190948"><span class="hs-identifier hs-var">flatten_todos</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190947"><span class="hs-identifier hs-var">core_todo</span></a></span><span>
</span><span id="line-120"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-121"></span><span>    </span><span id="local-6989586621681190946"><span class="annot"><span class="annottext">opt_level :: Int
</span><a href="#local-6989586621681190946"><span class="hs-identifier hs-var hs-var">opt_level</span></a></span></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#optLevel"><span class="hs-identifier hs-var hs-var">optLevel</span></a></span><span>           </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-122"></span><span>    </span><span id="local-6989586621681190944"><span class="annot"><span class="annottext">phases :: Int
</span><a href="#local-6989586621681190944"><span class="hs-identifier hs-var hs-var">phases</span></a></span></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#simplPhases"><span class="hs-identifier hs-var hs-var">simplPhases</span></a></span><span>        </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-123"></span><span>    </span><span id="local-6989586621681190942"><span class="annot"><span class="annottext">max_iter :: Int
</span><a href="#local-6989586621681190942"><span class="hs-identifier hs-var hs-var">max_iter</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#maxSimplIterations"><span class="hs-identifier hs-var hs-var">maxSimplIterations</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-124"></span><span>    </span><span id="local-6989586621681190940"><span class="annot"><span class="annottext">rule_check :: Maybe String
</span><a href="#local-6989586621681190940"><span class="hs-identifier hs-var hs-var">rule_check</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe String
</span><a href="GHC.Driver.Session.html#ruleCheck"><span class="hs-identifier hs-var hs-var">ruleCheck</span></a></span><span>          </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-125"></span><span>    </span><span id="local-6989586621681190938"><span class="annot"><span class="annottext">call_arity :: Bool
</span><a href="#local-6989586621681190938"><span class="hs-identifier hs-var hs-var">call_arity</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_CallArity"><span class="hs-identifier hs-var">Opt_CallArity</span></a></span><span>                    </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-126"></span><span>    </span><span id="local-6989586621681190935"><span class="annot"><span class="annottext">exitification :: Bool
</span><a href="#local-6989586621681190935"><span class="hs-identifier hs-var hs-var">exitification</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_Exitification"><span class="hs-identifier hs-var">Opt_Exitification</span></a></span><span>                </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-127"></span><span>    </span><span id="local-6989586621681190933"><span class="annot"><span class="annottext">strictness :: Bool
</span><a href="#local-6989586621681190933"><span class="hs-identifier hs-var hs-var">strictness</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_Strictness"><span class="hs-identifier hs-var">Opt_Strictness</span></a></span><span>                   </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-128"></span><span>    </span><span id="local-6989586621681190931"><span class="annot"><span class="annottext">full_laziness :: Bool
</span><a href="#local-6989586621681190931"><span class="hs-identifier hs-var hs-var">full_laziness</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_FullLaziness"><span class="hs-identifier hs-var">Opt_FullLaziness</span></a></span><span>                 </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-129"></span><span>    </span><span id="local-6989586621681190929"><span class="annot"><span class="annottext">do_specialise :: Bool
</span><a href="#local-6989586621681190929"><span class="hs-identifier hs-var hs-var">do_specialise</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_Specialise"><span class="hs-identifier hs-var">Opt_Specialise</span></a></span><span>                   </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-130"></span><span>    </span><span id="local-6989586621681190927"><span class="annot"><span class="annottext">do_float_in :: Bool
</span><a href="#local-6989586621681190927"><span class="hs-identifier hs-var hs-var">do_float_in</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_FloatIn"><span class="hs-identifier hs-var">Opt_FloatIn</span></a></span><span>                      </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-131"></span><span>    </span><span id="local-6989586621681190925"><span class="annot"><span class="annottext">cse :: Bool
</span><a href="#local-6989586621681190925"><span class="hs-identifier hs-var hs-var">cse</span></a></span></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_CSE"><span class="hs-identifier hs-var">Opt_CSE</span></a></span><span>                          </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-132"></span><span>    </span><span id="local-6989586621681190923"><span class="annot"><span class="annottext">spec_constr :: Bool
</span><a href="#local-6989586621681190923"><span class="hs-identifier hs-var hs-var">spec_constr</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_SpecConstr"><span class="hs-identifier hs-var">Opt_SpecConstr</span></a></span><span>                   </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-133"></span><span>    </span><span id="local-6989586621681190921"><span class="annot"><span class="annottext">liberate_case :: Bool
</span><a href="#local-6989586621681190921"><span class="hs-identifier hs-var hs-var">liberate_case</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_LiberateCase"><span class="hs-identifier hs-var">Opt_LiberateCase</span></a></span><span>                 </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-134"></span><span>    </span><span id="local-6989586621681190919"><span class="annot"><span class="annottext">late_dmd_anal :: Bool
</span><a href="#local-6989586621681190919"><span class="hs-identifier hs-var hs-var">late_dmd_anal</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_LateDmdAnal"><span class="hs-identifier hs-var">Opt_LateDmdAnal</span></a></span><span>                  </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-135"></span><span>    </span><span id="local-6989586621681190917"><span class="annot"><span class="annottext">late_specialise :: Bool
</span><a href="#local-6989586621681190917"><span class="hs-identifier hs-var hs-var">late_specialise</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_LateSpecialise"><span class="hs-identifier hs-var">Opt_LateSpecialise</span></a></span><span>             </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-136"></span><span>    </span><span id="local-6989586621681190915"><span class="annot"><span class="annottext">static_args :: Bool
</span><a href="#local-6989586621681190915"><span class="hs-identifier hs-var hs-var">static_args</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_StaticArgumentTransformation"><span class="hs-identifier hs-var">Opt_StaticArgumentTransformation</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-137"></span><span>    </span><span id="local-6989586621681190913"><span class="annot"><span class="annottext">rules_on :: Bool
</span><a href="#local-6989586621681190913"><span class="hs-identifier hs-var hs-var">rules_on</span></a></span></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_EnableRewriteRules"><span class="hs-identifier hs-var">Opt_EnableRewriteRules</span></a></span><span>           </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-138"></span><span>    </span><span id="local-6989586621681190911"><span class="annot"><span class="annottext">eta_expand_on :: Bool
</span><a href="#local-6989586621681190911"><span class="hs-identifier hs-var hs-var">eta_expand_on</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_DoLambdaEtaExpansion"><span class="hs-identifier hs-var">Opt_DoLambdaEtaExpansion</span></a></span><span>         </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-139"></span><span>    </span><span id="local-6989586621681190909"><span class="annot"><span class="annottext">ww_on :: Bool
</span><a href="#local-6989586621681190909"><span class="hs-identifier hs-var hs-var">ww_on</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">GeneralFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#gopt"><span class="hs-identifier hs-var">gopt</span></a></span><span> </span><span class="annot"><span class="annottext">GeneralFlag
</span><a href="GHC.Driver.Flags.html#Opt_WorkerWrapper"><span class="hs-identifier hs-var">Opt_WorkerWrapper</span></a></span><span>                </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-140"></span><span>    </span><span id="local-6989586621681190907"><span class="annot"><span class="annottext">static_ptrs :: Bool
</span><a href="#local-6989586621681190907"><span class="hs-identifier hs-var hs-var">static_ptrs</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Extension -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#xopt"><span class="hs-identifier hs-var">xopt</span></a></span><span> </span><span class="annot"><span class="annottext">Extension
</span><a href="../../ghc-boot-th/src/GHC.LanguageExtensions.Type.html#StaticPointers"><span class="hs-identifier hs-var">LangExt.StaticPointers</span></a></span><span>           </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-141"></span><span>
</span><span id="line-142"></span><span>    </span><span id="local-6989586621681190904"><span class="annot"><span class="annottext">maybe_rule_check :: CompilerPhase -&gt; CoreToDo
</span><a href="#local-6989586621681190904"><span class="hs-identifier hs-var hs-var">maybe_rule_check</span></a></span></span><span> </span><span id="local-6989586621681190903"><span class="annot"><span class="annottext">CompilerPhase
</span><a href="#local-6989586621681190903"><span class="hs-identifier hs-var">phase</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe String -&gt; (String -&gt; CoreToDo) -&gt; CoreToDo
forall a. Maybe a -&gt; (a -&gt; CoreToDo) -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#runMaybe"><span class="hs-identifier hs-var">runMaybe</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe String
</span><a href="#local-6989586621681190940"><span class="hs-identifier hs-var">rule_check</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CompilerPhase -&gt; String -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoRuleCheck"><span class="hs-identifier hs-var">CoreDoRuleCheck</span></a></span><span> </span><span class="annot"><span class="annottext">CompilerPhase
</span><a href="#local-6989586621681190903"><span class="hs-identifier hs-var">phase</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-143"></span><span>
</span><span id="line-144"></span><span>    </span><span id="local-6989586621681190897"><span class="annot"><span class="annottext">maybe_strictness_before :: CompilerPhase -&gt; CoreToDo
</span><a href="#local-6989586621681190897"><span class="hs-identifier hs-var hs-var">maybe_strictness_before</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Basic.html#Phase"><span class="hs-identifier hs-type">Phase</span></a></span><span> </span><span id="local-6989586621681190895"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190895"><span class="hs-identifier hs-var">phase</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-145"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190895"><span class="hs-identifier hs-var">phase</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; [Int] -&gt; Bool
forall (t :: * -&gt; *) a. (Foldable t, Eq a) =&gt; a -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#elem"><span class="hs-operator hs-var">`elem`</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; [Int]
</span><a href="GHC.Driver.Session.html#strictnessBefore"><span class="hs-identifier hs-var hs-var">strictnessBefore</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoDemand"><span class="hs-identifier hs-var">CoreDoDemand</span></a></span><span>
</span><span id="line-146"></span><span>    </span><span class="annot"><a href="#local-6989586621681190897"><span class="hs-identifier hs-var">maybe_strictness_before</span></a></span><span> </span><span class="annot"><span class="annottext">CompilerPhase
</span><span class="hs-identifier">_</span></span><span>
</span><span id="line-147"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoNothing"><span class="hs-identifier hs-var">CoreDoNothing</span></a></span><span>
</span><span id="line-148"></span><span>
</span><span id="line-149"></span><span>    </span><span id="local-6989586621681190890"><span class="annot"><span class="annottext">base_mode :: SimplMode
</span><a href="#local-6989586621681190890"><span class="hs-identifier hs-var hs-var">base_mode</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SimplMode :: [String]
-&gt; CompilerPhase
-&gt; DynFlags
-&gt; Bool
-&gt; Bool
-&gt; Bool
-&gt; Bool
-&gt; SimplMode
</span><a href="GHC.Core.Opt.Monad.html#SimplMode"><span class="hs-identifier hs-type">SimplMode</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sm_phase :: CompilerPhase
</span><a href="GHC.Core.Opt.Monad.html#sm_phase"><span class="hs-identifier hs-var">sm_phase</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; CompilerPhase
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;base_mode&quot;</span></span><span>
</span><span id="line-150"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sm_names :: [String]
</span><a href="GHC.Core.Opt.Monad.html#sm_names"><span class="hs-identifier hs-var">sm_names</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-151"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sm_dflags :: DynFlags
</span><a href="GHC.Core.Opt.Monad.html#sm_dflags"><span class="hs-identifier hs-var">sm_dflags</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-152"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sm_rules :: Bool
</span><a href="GHC.Core.Opt.Monad.html#sm_rules"><span class="hs-identifier hs-var">sm_rules</span></a></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190913"><span class="hs-identifier hs-var">rules_on</span></a></span><span>
</span><span id="line-153"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sm_eta_expand :: Bool
</span><a href="GHC.Core.Opt.Monad.html#sm_eta_expand"><span class="hs-identifier hs-var">sm_eta_expand</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190911"><span class="hs-identifier hs-var">eta_expand_on</span></a></span><span>
</span><span id="line-154"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sm_inline :: Bool
</span><a href="GHC.Core.Opt.Monad.html#sm_inline"><span class="hs-identifier hs-var">sm_inline</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-155"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sm_case_case :: Bool
</span><a href="GHC.Core.Opt.Monad.html#sm_case_case"><span class="hs-identifier hs-var">sm_case_case</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-156"></span><span>
</span><span id="line-157"></span><span>    </span><span id="local-6989586621681190880"><span class="annot"><span class="annottext">simpl_phase :: CompilerPhase -&gt; String -&gt; Int -&gt; CoreToDo
</span><a href="#local-6989586621681190880"><span class="hs-identifier hs-var hs-var">simpl_phase</span></a></span></span><span> </span><span id="local-6989586621681190879"><span class="annot"><span class="annottext">CompilerPhase
</span><a href="#local-6989586621681190879"><span class="hs-identifier hs-var">phase</span></a></span></span><span> </span><span id="local-6989586621681190878"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681190878"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span id="local-6989586621681190877"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190877"><span class="hs-identifier hs-var">iter</span></a></span></span><span>
</span><span id="line-158"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreToDo] -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoPasses"><span class="hs-identifier hs-var">CoreDoPasses</span></a></span><span>
</span><span id="line-159"></span><span>      </span><span class="annot"><span class="annottext">([CoreToDo] -&gt; CoreToDo) -&gt; [CoreToDo] -&gt; CoreToDo
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>   </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CompilerPhase -&gt; CoreToDo
</span><a href="#local-6989586621681190897"><span class="hs-identifier hs-var">maybe_strictness_before</span></a></span><span> </span><span class="annot"><span class="annottext">CompilerPhase
</span><a href="#local-6989586621681190879"><span class="hs-identifier hs-var">phase</span></a></span><span>
</span><span id="line-160"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int -&gt; SimplMode -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoSimplify"><span class="hs-identifier hs-var">CoreDoSimplify</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190877"><span class="hs-identifier hs-var">iter</span></a></span><span>
</span><span id="line-161"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SimplMode
</span><a href="#local-6989586621681190890"><span class="hs-identifier hs-var">base_mode</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sm_phase :: CompilerPhase
</span><a href="GHC.Core.Opt.Monad.html#sm_phase"><span class="hs-identifier hs-var">sm_phase</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CompilerPhase
</span><a href="#local-6989586621681190879"><span class="hs-identifier hs-var">phase</span></a></span><span>
</span><span id="line-162"></span><span>                           </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sm_names :: [String]
</span><a href="GHC.Core.Opt.Monad.html#sm_names"><span class="hs-identifier hs-var">sm_names</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681190878"><span class="hs-identifier hs-var">name</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-163"></span><span>
</span><span id="line-164"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CompilerPhase -&gt; CoreToDo
</span><a href="#local-6989586621681190904"><span class="hs-identifier hs-var">maybe_rule_check</span></a></span><span> </span><span class="annot"><span class="annottext">CompilerPhase
</span><a href="#local-6989586621681190879"><span class="hs-identifier hs-var">phase</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-165"></span><span>
</span><span id="line-166"></span><span>    </span><span class="hs-comment">-- Run GHC's internal simplification phase, after all rules have run.</span><span>
</span><span id="line-167"></span><span>    </span><span class="hs-comment">-- See Note [Compiler phases] in GHC.Types.Basic</span><span>
</span><span id="line-168"></span><span>    </span><span id="local-6989586621681190874"><span class="annot"><span class="annottext">simplify :: String -&gt; CoreToDo
</span><a href="#local-6989586621681190874"><span class="hs-identifier hs-var hs-var">simplify</span></a></span></span><span> </span><span id="local-6989586621681190873"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681190873"><span class="hs-identifier hs-var">name</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CompilerPhase -&gt; String -&gt; Int -&gt; CoreToDo
</span><a href="#local-6989586621681190880"><span class="hs-identifier hs-var">simpl_phase</span></a></span><span> </span><span class="annot"><span class="annottext">CompilerPhase
</span><a href="GHC.Types.Basic.html#FinalPhase"><span class="hs-identifier hs-var">FinalPhase</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681190873"><span class="hs-identifier hs-var">name</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190942"><span class="hs-identifier hs-var">max_iter</span></a></span><span>
</span><span id="line-169"></span><span>
</span><span id="line-170"></span><span>    </span><span class="hs-comment">-- initial simplify: mk specialiser happy: minimum effort please</span><span>
</span><span id="line-171"></span><span>    </span><span id="local-6989586621681190871"><span class="annot"><span class="annottext">simpl_gently :: CoreToDo
</span><a href="#local-6989586621681190871"><span class="hs-identifier hs-var hs-var">simpl_gently</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; SimplMode -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoSimplify"><span class="hs-identifier hs-var">CoreDoSimplify</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190942"><span class="hs-identifier hs-var">max_iter</span></a></span><span>
</span><span id="line-172"></span><span>                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SimplMode
</span><a href="#local-6989586621681190890"><span class="hs-identifier hs-var">base_mode</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sm_phase :: CompilerPhase
</span><a href="GHC.Core.Opt.Monad.html#sm_phase"><span class="hs-identifier hs-var">sm_phase</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CompilerPhase
</span><a href="GHC.Types.Basic.html#InitialPhase"><span class="hs-identifier hs-var">InitialPhase</span></a></span><span>
</span><span id="line-173"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sm_names :: [String]
</span><a href="GHC.Core.Opt.Monad.html#sm_names"><span class="hs-identifier hs-var">sm_names</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Gentle&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-174"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sm_rules :: Bool
</span><a href="GHC.Core.Opt.Monad.html#sm_rules"><span class="hs-identifier hs-var">sm_rules</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190913"><span class="hs-identifier hs-var">rules_on</span></a></span><span>   </span><span class="hs-comment">-- Note [RULEs enabled in InitialPhase]</span><span>
</span><span id="line-175"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sm_inline :: Bool
</span><a href="GHC.Core.Opt.Monad.html#sm_inline"><span class="hs-identifier hs-var">sm_inline</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-176"></span><span>                                              </span><span class="hs-comment">-- See Note [Inline in InitialPhase]</span><span>
</span><span id="line-177"></span><span>                                  </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sm_case_case :: Bool
</span><a href="GHC.Core.Opt.Monad.html#sm_case_case"><span class="hs-identifier hs-var">sm_case_case</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-178"></span><span>                          </span><span class="hs-comment">-- Don't do case-of-case transformations.</span><span>
</span><span id="line-179"></span><span>                          </span><span class="hs-comment">-- This makes full laziness work better</span><span>
</span><span id="line-180"></span><span>
</span><span id="line-181"></span><span>    </span><span id="local-6989586621681190869"><span class="annot"><span class="annottext">dmd_cpr_ww :: [CoreToDo]
</span><a href="#local-6989586621681190869"><span class="hs-identifier hs-var hs-var">dmd_cpr_ww</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190909"><span class="hs-identifier hs-var">ww_on</span></a></span><span> </span><span class="hs-keyword">then</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoDemand"><span class="hs-identifier hs-var">CoreDoDemand</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoCpr"><span class="hs-identifier hs-var">CoreDoCpr</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoWorkerWrapper"><span class="hs-identifier hs-var">CoreDoWorkerWrapper</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-182"></span><span>                          </span><span class="hs-keyword">else</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoDemand"><span class="hs-identifier hs-var">CoreDoDemand</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoCpr"><span class="hs-identifier hs-var">CoreDoCpr</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-183"></span><span>
</span><span id="line-184"></span><span>
</span><span id="line-185"></span><span>    </span><span id="local-6989586621681190866"><span class="annot"><span class="annottext">demand_analyser :: CoreToDo
</span><a href="#local-6989586621681190866"><span class="hs-identifier hs-var hs-var">demand_analyser</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CoreToDo] -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoPasses"><span class="hs-identifier hs-var">CoreDoPasses</span></a></span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-186"></span><span>                           </span><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190869"><span class="hs-identifier hs-var">dmd_cpr_ww</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreToDo] -&gt; [CoreToDo] -&gt; [CoreToDo]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span>
</span><span id="line-187"></span><span>                           </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; CoreToDo
</span><a href="#local-6989586621681190874"><span class="hs-identifier hs-var">simplify</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;post-worker-wrapper&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-188"></span><span>                           </span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-189"></span><span>
</span><span id="line-190"></span><span>    </span><span class="hs-comment">-- Static forms are moved to the top level with the FloatOut pass.</span><span>
</span><span id="line-191"></span><span>    </span><span class="hs-comment">-- See Note [Grand plan for static forms] in GHC.Iface.Tidy.StaticPtrTable.</span><span>
</span><span id="line-192"></span><span>    </span><span id="local-6989586621681190864"><span class="annot"><span class="annottext">static_ptrs_float_outwards :: CoreToDo
</span><a href="#local-6989586621681190864"><span class="hs-identifier hs-var hs-var">static_ptrs_float_outwards</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-193"></span><span>      </span><span class="annot"><span class="annottext">Bool -&gt; CoreToDo -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#runWhen"><span class="hs-identifier hs-var">runWhen</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190907"><span class="hs-identifier hs-var">static_ptrs</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreToDo -&gt; CoreToDo) -&gt; CoreToDo -&gt; CoreToDo
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreToDo] -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoPasses"><span class="hs-identifier hs-var">CoreDoPasses</span></a></span><span>
</span><span id="line-194"></span><span>        </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190871"><span class="hs-identifier hs-var">simpl_gently</span></a></span><span> </span><span class="hs-comment">-- Float Out can't handle type lets (sometimes created</span><span>
</span><span id="line-195"></span><span>                       </span><span class="hs-comment">-- by simpleOptPgm via mkParallelBindings)</span><span>
</span><span id="line-196"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">FloatOutSwitches -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoFloatOutwards"><span class="hs-identifier hs-var">CoreDoFloatOutwards</span></a></span><span> </span><span class="annot"><span class="annottext">FloatOutSwitches :: Maybe Int -&gt; Bool -&gt; Bool -&gt; Bool -&gt; FloatOutSwitches
</span><a href="GHC.Core.Opt.Monad.html#FloatOutSwitches"><span class="hs-identifier hs-type">FloatOutSwitches</span></a></span><span>
</span><span id="line-197"></span><span>          </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">floatOutLambdas :: Maybe Int
</span><a href="GHC.Core.Opt.Monad.html#floatOutLambdas"><span class="hs-identifier hs-var">floatOutLambdas</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Maybe Int
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-198"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">floatOutConstants :: Bool
</span><a href="GHC.Core.Opt.Monad.html#floatOutConstants"><span class="hs-identifier hs-var">floatOutConstants</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-199"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">floatOutOverSatApps :: Bool
</span><a href="GHC.Core.Opt.Monad.html#floatOutOverSatApps"><span class="hs-identifier hs-var">floatOutOverSatApps</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-200"></span><span>          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">floatToTopLevelOnly :: Bool
</span><a href="GHC.Core.Opt.Monad.html#floatToTopLevelOnly"><span class="hs-identifier hs-var">floatToTopLevelOnly</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>
</span><span id="line-201"></span><span>          </span><span class="hs-special">}</span><span>
</span><span id="line-202"></span><span>        </span><span class="hs-special">]</span><span>
</span><span id="line-203"></span><span>
</span><span id="line-204"></span><span>    </span><span id="local-6989586621681190947"><span class="annot"><span class="annottext">core_todo :: [CoreToDo]
</span><a href="#local-6989586621681190947"><span class="hs-identifier hs-var hs-var">core_todo</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-205"></span><span>     </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190946"><span class="hs-identifier hs-var">opt_level</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span> </span><span class="hs-keyword">then</span><span>
</span><span id="line-206"></span><span>       </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190864"><span class="hs-identifier hs-var">static_ptrs_float_outwards</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-207"></span><span>         </span><span class="annot"><span class="annottext">Int -&gt; SimplMode -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoSimplify"><span class="hs-identifier hs-var">CoreDoSimplify</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190942"><span class="hs-identifier hs-var">max_iter</span></a></span><span>
</span><span id="line-208"></span><span>             </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SimplMode
</span><a href="#local-6989586621681190890"><span class="hs-identifier hs-var">base_mode</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">sm_phase :: CompilerPhase
</span><a href="GHC.Core.Opt.Monad.html#sm_phase"><span class="hs-identifier hs-var">sm_phase</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CompilerPhase
</span><a href="GHC.Types.Basic.html#FinalPhase"><span class="hs-identifier hs-var">FinalPhase</span></a></span><span>
</span><span id="line-209"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">sm_names :: [String]
</span><a href="GHC.Core.Opt.Monad.html#sm_names"><span class="hs-identifier hs-var">sm_names</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Non-opt simplification&quot;</span></span><span class="hs-special">]</span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-210"></span><span>       </span><span class="hs-special">]</span><span>
</span><span id="line-211"></span><span>
</span><span id="line-212"></span><span>     </span><span class="hs-keyword">else</span><span> </span><span class="hs-comment">{- opt_level &gt;= 1 -}</span><span> </span><span class="hs-special">[</span><span>
</span><span id="line-213"></span><span>
</span><span id="line-214"></span><span>    </span><span class="hs-comment">-- We want to do the static argument transform before full laziness as it</span><span>
</span><span id="line-215"></span><span>    </span><span class="hs-comment">-- may expose extra opportunities to float things outwards. However, to fix</span><span>
</span><span id="line-216"></span><span>    </span><span class="hs-comment">-- up the output of the transformation we need at do at least one simplify</span><span>
</span><span id="line-217"></span><span>    </span><span class="hs-comment">-- after this before anything else</span><span>
</span><span id="line-218"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; CoreToDo -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#runWhen"><span class="hs-identifier hs-var">runWhen</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190915"><span class="hs-identifier hs-var">static_args</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CoreToDo] -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoPasses"><span class="hs-identifier hs-var">CoreDoPasses</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190871"><span class="hs-identifier hs-var">simpl_gently</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoStaticArgs"><span class="hs-identifier hs-var">CoreDoStaticArgs</span></a></span><span> </span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-219"></span><span>
</span><span id="line-220"></span><span>        </span><span class="hs-comment">-- initial simplify: mk specialiser happy: minimum effort please</span><span>
</span><span id="line-221"></span><span>        </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190871"><span class="hs-identifier hs-var">simpl_gently</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-222"></span><span>
</span><span id="line-223"></span><span>        </span><span class="hs-comment">-- Specialisation is best done before full laziness</span><span>
</span><span id="line-224"></span><span>        </span><span class="hs-comment">-- so that overloaded functions have all their dictionary lambdas manifest</span><span>
</span><span id="line-225"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; CoreToDo -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#runWhen"><span class="hs-identifier hs-var">runWhen</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190929"><span class="hs-identifier hs-var">do_specialise</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoSpecialising"><span class="hs-identifier hs-var">CoreDoSpecialising</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-226"></span><span>
</span><span id="line-227"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190931"><span class="hs-identifier hs-var">full_laziness</span></a></span><span> </span><span class="hs-keyword">then</span><span>
</span><span id="line-228"></span><span>           </span><span class="annot"><span class="annottext">FloatOutSwitches -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoFloatOutwards"><span class="hs-identifier hs-var">CoreDoFloatOutwards</span></a></span><span> </span><span class="annot"><span class="annottext">FloatOutSwitches :: Maybe Int -&gt; Bool -&gt; Bool -&gt; Bool -&gt; FloatOutSwitches
</span><a href="GHC.Core.Opt.Monad.html#FloatOutSwitches"><span class="hs-identifier hs-type">FloatOutSwitches</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-229"></span><span>                                 </span><span class="annot"><span class="annottext">floatOutLambdas :: Maybe Int
</span><a href="GHC.Core.Opt.Monad.html#floatOutLambdas"><span class="hs-identifier hs-var">floatOutLambdas</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int -&gt; Maybe Int
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">,</span><span>
</span><span id="line-230"></span><span>                                 </span><span class="annot"><span class="annottext">floatOutConstants :: Bool
</span><a href="GHC.Core.Opt.Monad.html#floatOutConstants"><span class="hs-identifier hs-var">floatOutConstants</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">,</span><span>
</span><span id="line-231"></span><span>                                 </span><span class="annot"><span class="annottext">floatOutOverSatApps :: Bool
</span><a href="GHC.Core.Opt.Monad.html#floatOutOverSatApps"><span class="hs-identifier hs-var">floatOutOverSatApps</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span class="hs-special">,</span><span>
</span><span id="line-232"></span><span>                                 </span><span class="annot"><span class="annottext">floatToTopLevelOnly :: Bool
</span><a href="GHC.Core.Opt.Monad.html#floatToTopLevelOnly"><span class="hs-identifier hs-var">floatToTopLevelOnly</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-233"></span><span>                </span><span class="hs-comment">-- Was: gentleFloatOutSwitches</span><span>
</span><span id="line-234"></span><span>                </span><span class="hs-comment">--</span><span>
</span><span id="line-235"></span><span>                </span><span class="hs-comment">-- I have no idea why, but not floating constants to</span><span>
</span><span id="line-236"></span><span>                </span><span class="hs-comment">-- top level is very bad in some cases.</span><span>
</span><span id="line-237"></span><span>                </span><span class="hs-comment">--</span><span>
</span><span id="line-238"></span><span>                </span><span class="hs-comment">-- Notably: p_ident in spectral/rewrite</span><span>
</span><span id="line-239"></span><span>                </span><span class="hs-comment">--          Changing from &quot;gentle&quot; to &quot;constantsOnly&quot;</span><span>
</span><span id="line-240"></span><span>                </span><span class="hs-comment">--          improved rewrite's allocation by 19%, and</span><span>
</span><span id="line-241"></span><span>                </span><span class="hs-comment">--          made 0.0% difference to any other nofib</span><span>
</span><span id="line-242"></span><span>                </span><span class="hs-comment">--          benchmark</span><span>
</span><span id="line-243"></span><span>                </span><span class="hs-comment">--</span><span>
</span><span id="line-244"></span><span>                </span><span class="hs-comment">-- Not doing floatOutOverSatApps yet, we'll do</span><span>
</span><span id="line-245"></span><span>                </span><span class="hs-comment">-- that later on when we've had a chance to get more</span><span>
</span><span id="line-246"></span><span>                </span><span class="hs-comment">-- accurate arity information.  In fact it makes no</span><span>
</span><span id="line-247"></span><span>                </span><span class="hs-comment">-- difference at all to performance if we do it here,</span><span>
</span><span id="line-248"></span><span>                </span><span class="hs-comment">-- but maybe we save some unnecessary to-and-fro in</span><span>
</span><span id="line-249"></span><span>                </span><span class="hs-comment">-- the simplifier.</span><span>
</span><span id="line-250"></span><span>        </span><span class="hs-keyword">else</span><span>
</span><span id="line-251"></span><span>           </span><span class="hs-comment">-- Even with full laziness turned off, we still need to float static</span><span>
</span><span id="line-252"></span><span>           </span><span class="hs-comment">-- forms to the top level. See Note [Grand plan for static forms] in</span><span>
</span><span id="line-253"></span><span>           </span><span class="hs-comment">-- GHC.Iface.Tidy.StaticPtrTable.</span><span>
</span><span id="line-254"></span><span>           </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190864"><span class="hs-identifier hs-var">static_ptrs_float_outwards</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-255"></span><span>
</span><span id="line-256"></span><span>        </span><span class="hs-comment">-- Run the simplier phases 2,1,0 to allow rewrite rules to fire</span><span>
</span><span id="line-257"></span><span>        </span><span class="annot"><span class="annottext">[CoreToDo] -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoPasses"><span class="hs-identifier hs-var">CoreDoPasses</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CompilerPhase -&gt; String -&gt; Int -&gt; CoreToDo
</span><a href="#local-6989586621681190880"><span class="hs-identifier hs-var">simpl_phase</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; CompilerPhase
</span><a href="GHC.Types.Basic.html#Phase"><span class="hs-identifier hs-var">Phase</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190844"><span class="hs-identifier hs-var">phase</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;main&quot;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190942"><span class="hs-identifier hs-var">max_iter</span></a></span><span>
</span><span id="line-258"></span><span>                     </span><span class="hs-glyph">|</span><span> </span><span id="local-6989586621681190844"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190844"><span class="hs-identifier hs-var">phase</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190944"><span class="hs-identifier hs-var">phases</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190944"><span class="hs-identifier hs-var">phases</span></a></span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-glyph">..</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">]</span><span> </span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-259"></span><span>        </span><span class="annot"><span class="annottext">CompilerPhase -&gt; String -&gt; Int -&gt; CoreToDo
</span><a href="#local-6989586621681190880"><span class="hs-identifier hs-var">simpl_phase</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; CompilerPhase
</span><a href="GHC.Types.Basic.html#Phase"><span class="hs-identifier hs-var">Phase</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;main&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Ord a =&gt; a -&gt; a -&gt; a
</span><span class="hs-identifier hs-var">max</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190942"><span class="hs-identifier hs-var">max_iter</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">3</span></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-260"></span><span>                </span><span class="hs-comment">-- Phase 0: allow all Ids to be inlined now</span><span>
</span><span id="line-261"></span><span>                </span><span class="hs-comment">-- This gets foldr inlined before strictness analysis</span><span>
</span><span id="line-262"></span><span>
</span><span id="line-263"></span><span>                </span><span class="hs-comment">-- At least 3 iterations because otherwise we land up with</span><span>
</span><span id="line-264"></span><span>                </span><span class="hs-comment">-- huge dead expressions because of an infelicity in the</span><span>
</span><span id="line-265"></span><span>                </span><span class="hs-comment">-- simplifier.</span><span>
</span><span id="line-266"></span><span>                </span><span class="hs-comment">--      let k = BIG in foldr k z xs</span><span>
</span><span id="line-267"></span><span>                </span><span class="hs-comment">-- ==&gt;  let k = BIG in letrec go = \xs -&gt; ...(k x).... in go xs</span><span>
</span><span id="line-268"></span><span>                </span><span class="hs-comment">-- ==&gt;  let k = BIG in letrec go = \xs -&gt; ...(BIG x).... in go xs</span><span>
</span><span id="line-269"></span><span>                </span><span class="hs-comment">-- Don't stop now!</span><span>
</span><span id="line-270"></span><span>
</span><span id="line-271"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; CoreToDo -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#runWhen"><span class="hs-identifier hs-var">runWhen</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190927"><span class="hs-identifier hs-var">do_float_in</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoFloatInwards"><span class="hs-identifier hs-var">CoreDoFloatInwards</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-272"></span><span>            </span><span class="hs-comment">-- Run float-inwards immediately before the strictness analyser</span><span>
</span><span id="line-273"></span><span>            </span><span class="hs-comment">-- Doing so pushes bindings nearer their use site and hence makes</span><span>
</span><span id="line-274"></span><span>            </span><span class="hs-comment">-- them more likely to be strict. These bindings might only show</span><span>
</span><span id="line-275"></span><span>            </span><span class="hs-comment">-- up after the inlining from simplification.  Example in fulsom,</span><span>
</span><span id="line-276"></span><span>            </span><span class="hs-comment">-- Csg.calc, where an arg of timesDouble thereby becomes strict.</span><span>
</span><span id="line-277"></span><span>
</span><span id="line-278"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; CoreToDo -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#runWhen"><span class="hs-identifier hs-var">runWhen</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190938"><span class="hs-identifier hs-var">call_arity</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreToDo -&gt; CoreToDo) -&gt; CoreToDo -&gt; CoreToDo
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreToDo] -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoPasses"><span class="hs-identifier hs-var">CoreDoPasses</span></a></span><span>
</span><span id="line-279"></span><span>            </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoCallArity"><span class="hs-identifier hs-var">CoreDoCallArity</span></a></span><span>
</span><span id="line-280"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; CoreToDo
</span><a href="#local-6989586621681190874"><span class="hs-identifier hs-var">simplify</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;post-call-arity&quot;</span></span><span>
</span><span id="line-281"></span><span>            </span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-282"></span><span>
</span><span id="line-283"></span><span>        </span><span class="hs-comment">-- Strictness analysis</span><span>
</span><span id="line-284"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; CoreToDo -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#runWhen"><span class="hs-identifier hs-var">runWhen</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190933"><span class="hs-identifier hs-var">strictness</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190866"><span class="hs-identifier hs-var">demand_analyser</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-285"></span><span>
</span><span id="line-286"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; CoreToDo -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#runWhen"><span class="hs-identifier hs-var">runWhen</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190935"><span class="hs-identifier hs-var">exitification</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoExitify"><span class="hs-identifier hs-var">CoreDoExitify</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-287"></span><span>            </span><span class="hs-comment">-- See note [Placement of the exitification pass]</span><span>
</span><span id="line-288"></span><span>
</span><span id="line-289"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; CoreToDo -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#runWhen"><span class="hs-identifier hs-var">runWhen</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190931"><span class="hs-identifier hs-var">full_laziness</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreToDo -&gt; CoreToDo) -&gt; CoreToDo -&gt; CoreToDo
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-290"></span><span>           </span><span class="annot"><span class="annottext">FloatOutSwitches -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoFloatOutwards"><span class="hs-identifier hs-var">CoreDoFloatOutwards</span></a></span><span> </span><span class="annot"><span class="annottext">FloatOutSwitches :: Maybe Int -&gt; Bool -&gt; Bool -&gt; Bool -&gt; FloatOutSwitches
</span><a href="GHC.Core.Opt.Monad.html#FloatOutSwitches"><span class="hs-identifier hs-type">FloatOutSwitches</span></a></span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-291"></span><span>                                 </span><span class="annot"><span class="annottext">floatOutLambdas :: Maybe Int
</span><a href="GHC.Core.Opt.Monad.html#floatOutLambdas"><span class="hs-identifier hs-var">floatOutLambdas</span></a></span><span>     </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Maybe Int
</span><a href="GHC.Driver.Session.html#floatLamArgs"><span class="hs-identifier hs-var hs-var">floatLamArgs</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190949"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-292"></span><span>                                 </span><span class="annot"><span class="annottext">floatOutConstants :: Bool
</span><a href="GHC.Core.Opt.Monad.html#floatOutConstants"><span class="hs-identifier hs-var">floatOutConstants</span></a></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">,</span><span>
</span><span id="line-293"></span><span>                                 </span><span class="annot"><span class="annottext">floatOutOverSatApps :: Bool
</span><a href="GHC.Core.Opt.Monad.html#floatOutOverSatApps"><span class="hs-identifier hs-var">floatOutOverSatApps</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span class="hs-special">,</span><span>
</span><span id="line-294"></span><span>                                 </span><span class="annot"><span class="annottext">floatToTopLevelOnly :: Bool
</span><a href="GHC.Core.Opt.Monad.html#floatToTopLevelOnly"><span class="hs-identifier hs-var">floatToTopLevelOnly</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span> </span><span class="hs-special">}</span><span class="hs-special">,</span><span>
</span><span id="line-295"></span><span>                </span><span class="hs-comment">-- nofib/spectral/hartel/wang doubles in speed if you</span><span>
</span><span id="line-296"></span><span>                </span><span class="hs-comment">-- do full laziness late in the day.  It only happens</span><span>
</span><span id="line-297"></span><span>                </span><span class="hs-comment">-- after fusion and other stuff, so the early pass doesn't</span><span>
</span><span id="line-298"></span><span>                </span><span class="hs-comment">-- catch it.  For the record, the redex is</span><span>
</span><span id="line-299"></span><span>                </span><span class="hs-comment">--        f_el22 (f_el21 r_midblock)</span><span>
</span><span id="line-300"></span><span>
</span><span id="line-301"></span><span>
</span><span id="line-302"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; CoreToDo -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#runWhen"><span class="hs-identifier hs-var">runWhen</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190925"><span class="hs-identifier hs-var">cse</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreCSE"><span class="hs-identifier hs-var">CoreCSE</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-303"></span><span>                </span><span class="hs-comment">-- We want CSE to follow the final full-laziness pass, because it may</span><span>
</span><span id="line-304"></span><span>                </span><span class="hs-comment">-- succeed in commoning up things floated out by full laziness.</span><span>
</span><span id="line-305"></span><span>                </span><span class="hs-comment">-- CSE used to rely on the no-shadowing invariant, but it doesn't any more</span><span>
</span><span id="line-306"></span><span>
</span><span id="line-307"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; CoreToDo -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#runWhen"><span class="hs-identifier hs-var">runWhen</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190927"><span class="hs-identifier hs-var">do_float_in</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoFloatInwards"><span class="hs-identifier hs-var">CoreDoFloatInwards</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-308"></span><span>
</span><span id="line-309"></span><span>        </span><span class="annot"><span class="annottext">CompilerPhase -&gt; CoreToDo
</span><a href="#local-6989586621681190904"><span class="hs-identifier hs-var">maybe_rule_check</span></a></span><span> </span><span class="annot"><span class="annottext">CompilerPhase
</span><a href="GHC.Types.Basic.html#FinalPhase"><span class="hs-identifier hs-var">FinalPhase</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-310"></span><span>
</span><span id="line-311"></span><span>                </span><span class="hs-comment">-- Case-liberation for -O2.  This should be after</span><span>
</span><span id="line-312"></span><span>                </span><span class="hs-comment">-- strictness analysis and the simplification which follows it.</span><span>
</span><span id="line-313"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; CoreToDo -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#runWhen"><span class="hs-identifier hs-var">runWhen</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190921"><span class="hs-identifier hs-var">liberate_case</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CoreToDo] -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoPasses"><span class="hs-identifier hs-var">CoreDoPasses</span></a></span><span> </span><span class="hs-special">[</span><span>
</span><span id="line-314"></span><span>            </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreLiberateCase"><span class="hs-identifier hs-var">CoreLiberateCase</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-315"></span><span>            </span><span class="annot"><span class="annottext">String -&gt; CoreToDo
</span><a href="#local-6989586621681190874"><span class="hs-identifier hs-var">simplify</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;post-liberate-case&quot;</span></span><span>
</span><span id="line-316"></span><span>            </span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">,</span><span>         </span><span class="hs-comment">-- Run the simplifier after LiberateCase to vastly</span><span>
</span><span id="line-317"></span><span>                        </span><span class="hs-comment">-- reduce the possibility of shadowing</span><span>
</span><span id="line-318"></span><span>                        </span><span class="hs-comment">-- Reason: see Note [Shadowing] in GHC.Core.Opt.SpecConstr</span><span>
</span><span id="line-319"></span><span>
</span><span id="line-320"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; CoreToDo -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#runWhen"><span class="hs-identifier hs-var">runWhen</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190923"><span class="hs-identifier hs-var">spec_constr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoSpecConstr"><span class="hs-identifier hs-var">CoreDoSpecConstr</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-321"></span><span>
</span><span id="line-322"></span><span>        </span><span class="annot"><span class="annottext">CompilerPhase -&gt; CoreToDo
</span><a href="#local-6989586621681190904"><span class="hs-identifier hs-var">maybe_rule_check</span></a></span><span> </span><span class="annot"><span class="annottext">CompilerPhase
</span><a href="GHC.Types.Basic.html#FinalPhase"><span class="hs-identifier hs-var">FinalPhase</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-323"></span><span>
</span><span id="line-324"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; CoreToDo -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#runWhen"><span class="hs-identifier hs-var">runWhen</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190917"><span class="hs-identifier hs-var">late_specialise</span></a></span><span>
</span><span id="line-325"></span><span>          </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CoreToDo] -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoPasses"><span class="hs-identifier hs-var">CoreDoPasses</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoSpecialising"><span class="hs-identifier hs-var">CoreDoSpecialising</span></a></span><span>
</span><span id="line-326"></span><span>                        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; CoreToDo
</span><a href="#local-6989586621681190874"><span class="hs-identifier hs-var">simplify</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;post-late-spec&quot;</span></span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-327"></span><span>
</span><span id="line-328"></span><span>        </span><span class="hs-comment">-- LiberateCase can yield new CSE opportunities because it peels</span><span>
</span><span id="line-329"></span><span>        </span><span class="hs-comment">-- off one layer of a recursive function (concretely, I saw this</span><span>
</span><span id="line-330"></span><span>        </span><span class="hs-comment">-- in wheel-sieve1), and I'm guessing that SpecConstr can too</span><span>
</span><span id="line-331"></span><span>        </span><span class="hs-comment">-- And CSE is a very cheap pass. So it seems worth doing here.</span><span>
</span><span id="line-332"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; CoreToDo -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#runWhen"><span class="hs-identifier hs-var">runWhen</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190921"><span class="hs-identifier hs-var">liberate_case</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190923"><span class="hs-identifier hs-var">spec_constr</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190925"><span class="hs-identifier hs-var">cse</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreCSE"><span class="hs-identifier hs-var">CoreCSE</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-333"></span><span>
</span><span id="line-334"></span><span>        </span><span class="hs-comment">-- Final clean-up simplification:</span><span>
</span><span id="line-335"></span><span>        </span><span class="annot"><span class="annottext">String -&gt; CoreToDo
</span><a href="#local-6989586621681190874"><span class="hs-identifier hs-var">simplify</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;final&quot;</span></span><span class="hs-special">,</span><span>
</span><span id="line-336"></span><span>
</span><span id="line-337"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; CoreToDo -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#runWhen"><span class="hs-identifier hs-var">runWhen</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190919"><span class="hs-identifier hs-var">late_dmd_anal</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreToDo -&gt; CoreToDo) -&gt; CoreToDo -&gt; CoreToDo
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreToDo] -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoPasses"><span class="hs-identifier hs-var">CoreDoPasses</span></a></span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-338"></span><span>            </span><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190869"><span class="hs-identifier hs-var">dmd_cpr_ww</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreToDo] -&gt; [CoreToDo] -&gt; [CoreToDo]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; CoreToDo
</span><a href="#local-6989586621681190874"><span class="hs-identifier hs-var">simplify</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;post-late-ww&quot;</span></span><span class="hs-special">]</span><span>
</span><span id="line-339"></span><span>          </span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-340"></span><span>
</span><span id="line-341"></span><span>        </span><span class="hs-comment">-- Final run of the demand_analyser, ensures that one-shot thunks are</span><span>
</span><span id="line-342"></span><span>        </span><span class="hs-comment">-- really really one-shot thunks. Only needed if the demand analyser</span><span>
</span><span id="line-343"></span><span>        </span><span class="hs-comment">-- has run at all. See Note [Final Demand Analyser run] in GHC.Core.Opt.DmdAnal</span><span>
</span><span id="line-344"></span><span>        </span><span class="hs-comment">-- It is EXTREMELY IMPORTANT to run this pass, otherwise execution</span><span>
</span><span id="line-345"></span><span>        </span><span class="hs-comment">-- can become /exponentially/ more expensive. See #11731, #12996.</span><span>
</span><span id="line-346"></span><span>        </span><span class="annot"><span class="annottext">Bool -&gt; CoreToDo -&gt; CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#runWhen"><span class="hs-identifier hs-var">runWhen</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190933"><span class="hs-identifier hs-var">strictness</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">||</span></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190919"><span class="hs-identifier hs-var">late_dmd_anal</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoDemand"><span class="hs-identifier hs-var">CoreDoDemand</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-347"></span><span>
</span><span id="line-348"></span><span>        </span><span class="annot"><span class="annottext">CompilerPhase -&gt; CoreToDo
</span><a href="#local-6989586621681190904"><span class="hs-identifier hs-var">maybe_rule_check</span></a></span><span> </span><span class="annot"><span class="annottext">CompilerPhase
</span><a href="GHC.Types.Basic.html#FinalPhase"><span class="hs-identifier hs-var">FinalPhase</span></a></span><span>
</span><span id="line-349"></span><span>     </span><span class="hs-special">]</span><span>
</span><span id="line-350"></span><span>
</span><span id="line-351"></span><span>    </span><span class="hs-comment">-- Remove 'CoreDoNothing' and flatten 'CoreDoPasses' for clarity.</span><span>
</span><span id="line-352"></span><span>    </span><span id="local-6989586621681190948"><span class="annot"><span class="annottext">flatten_todos :: [CoreToDo] -&gt; [CoreToDo]
</span><a href="#local-6989586621681190948"><span class="hs-identifier hs-var hs-var">flatten_todos</span></a></span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-353"></span><span>    </span><span class="annot"><a href="#local-6989586621681190948"><span class="hs-identifier hs-var">flatten_todos</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoNothing"><span class="hs-identifier hs-var">CoreDoNothing</span></a></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681190833"><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190833"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreToDo] -&gt; [CoreToDo]
</span><a href="#local-6989586621681190948"><span class="hs-identifier hs-var">flatten_todos</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190833"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-354"></span><span>    </span><span class="annot"><a href="#local-6989586621681190948"><span class="hs-identifier hs-var">flatten_todos</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreDoPasses"><span class="hs-identifier hs-type">CoreDoPasses</span></a></span><span> </span><span id="local-6989586621681190832"><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190832"><span class="hs-identifier hs-var">passes</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681190831"><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190831"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-355"></span><span>      </span><span class="annot"><span class="annottext">[CoreToDo] -&gt; [CoreToDo]
</span><a href="#local-6989586621681190948"><span class="hs-identifier hs-var">flatten_todos</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190832"><span class="hs-identifier hs-var">passes</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreToDo] -&gt; [CoreToDo] -&gt; [CoreToDo]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreToDo] -&gt; [CoreToDo]
</span><a href="#local-6989586621681190948"><span class="hs-identifier hs-var">flatten_todos</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190831"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-356"></span><span>    </span><span class="annot"><a href="#local-6989586621681190948"><span class="hs-identifier hs-var">flatten_todos</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681190830"><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190830"><span class="hs-identifier hs-var">todo</span></a></span></span><span> </span><span class="annot"><span class="hs-glyph hs-type">:</span></span><span> </span><span id="local-6989586621681190829"><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190829"><span class="hs-identifier hs-var">rest</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190830"><span class="hs-identifier hs-var">todo</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo -&gt; [CoreToDo] -&gt; [CoreToDo]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[CoreToDo] -&gt; [CoreToDo]
</span><a href="#local-6989586621681190948"><span class="hs-identifier hs-var">flatten_todos</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190829"><span class="hs-identifier hs-var">rest</span></a></span><span>
</span><span id="line-357"></span><span>
</span><span id="line-358"></span><span class="hs-comment">{- Note [Inline in InitialPhase]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In GHC 8 and earlier we did not inline anything in the InitialPhase. But that is
confusing for users because when they say INLINE they expect the function to inline
right away.

So now we do inlining immediately, even in the InitialPhase, assuming that the
Id's Activation allows it.

This is a surprisingly big deal. Compiler performance improved a lot
when I made this change:

   perf/compiler/T5837.run            T5837 [stat too good] (normal)
   perf/compiler/parsing001.run       parsing001 [stat too good] (normal)
   perf/compiler/T12234.run           T12234 [stat too good] (optasm)
   perf/compiler/T9020.run            T9020 [stat too good] (optasm)
   perf/compiler/T3064.run            T3064 [stat too good] (normal)
   perf/compiler/T9961.run            T9961 [stat too good] (normal)
   perf/compiler/T13056.run           T13056 [stat too good] (optasm)
   perf/compiler/T9872d.run           T9872d [stat too good] (normal)
   perf/compiler/T783.run             T783 [stat too good] (normal)
   perf/compiler/T12227.run           T12227 [stat too good] (normal)
   perf/should_run/lazy-bs-alloc.run  lazy-bs-alloc [stat too good] (normal)
   perf/compiler/T1969.run            T1969 [stat too good] (normal)
   perf/compiler/T9872a.run           T9872a [stat too good] (normal)
   perf/compiler/T9872c.run           T9872c [stat too good] (normal)
   perf/compiler/T9872b.run           T9872b [stat too good] (normal)
   perf/compiler/T9872d.run           T9872d [stat too good] (normal)

Note [RULEs enabled in InitialPhase]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
RULES are enabled when doing &quot;gentle&quot; simplification in InitialPhase,
or with -O0.  Two reasons:

  * We really want the class-op cancellation to happen:
        op (df d1 d2) --&gt; $cop3 d1 d2
    because this breaks the mutual recursion between 'op' and 'df'

  * I wanted the RULE
        lift String ===&gt; ...
    to work in Template Haskell when simplifying
    splices, so we get simpler code for literal strings

But watch out: list fusion can prevent floating.  So use phase control
to switch off those rules until after floating.

************************************************************************
*                                                                      *
                  The CoreToDo interpreter
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-410"></span><span>
</span><span id="line-411"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#runCorePasses"><span class="hs-identifier hs-type">runCorePasses</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreToDo"><span class="hs-identifier hs-type">CoreToDo</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreM"><span class="hs-identifier hs-type">CoreM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span>
</span><span id="line-412"></span><span id="runCorePasses"><span class="annot"><span class="annottext">runCorePasses :: [CoreToDo] -&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#runCorePasses"><span class="hs-identifier hs-var hs-var">runCorePasses</span></a></span></span><span> </span><span id="local-6989586621681190828"><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190828"><span class="hs-identifier hs-var">passes</span></a></span></span><span> </span><span id="local-6989586621681190827"><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190827"><span class="hs-identifier hs-var">guts</span></a></span></span><span>
</span><span id="line-413"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(ModGuts -&gt; CoreToDo -&gt; CoreM ModGuts)
-&gt; ModGuts -&gt; [CoreToDo] -&gt; CoreM ModGuts
forall (t :: * -&gt; *) (m :: * -&gt; *) b a.
(Foldable t, Monad m) =&gt;
(b -&gt; a -&gt; m b) -&gt; b -&gt; t a -&gt; m b
</span><a href="../../base/src/Control.Monad.html#foldM"><span class="hs-identifier hs-var">foldM</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts -&gt; CoreToDo -&gt; CoreM ModGuts
</span><a href="#local-6989586621681190825"><span class="hs-identifier hs-var">do_pass</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190827"><span class="hs-identifier hs-var">guts</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190828"><span class="hs-identifier hs-var">passes</span></a></span><span>
</span><span id="line-414"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-415"></span><span>    </span><span id="local-6989586621681190825"><span class="annot"><span class="annottext">do_pass :: ModGuts -&gt; CoreToDo -&gt; CoreM ModGuts
</span><a href="#local-6989586621681190825"><span class="hs-identifier hs-var hs-var">do_pass</span></a></span></span><span> </span><span id="local-6989586621681190815"><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190815"><span class="hs-identifier hs-var">guts</span></a></span></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoNothing"><span class="hs-identifier hs-var">CoreDoNothing</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModGuts -&gt; CoreM ModGuts
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190815"><span class="hs-identifier hs-var">guts</span></a></span><span>
</span><span id="line-416"></span><span>    </span><span class="annot"><a href="#local-6989586621681190825"><span class="hs-identifier hs-var">do_pass</span></a></span><span> </span><span id="local-6989586621681190814"><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190814"><span class="hs-identifier hs-var">guts</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreDoPasses"><span class="hs-identifier hs-type">CoreDoPasses</span></a></span><span> </span><span id="local-6989586621681190813"><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190813"><span class="hs-identifier hs-var">ps</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreToDo] -&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#runCorePasses"><span class="hs-identifier hs-var">runCorePasses</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190813"><span class="hs-identifier hs-var">ps</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190814"><span class="hs-identifier hs-var">guts</span></a></span><span>
</span><span id="line-417"></span><span>    </span><span class="annot"><a href="#local-6989586621681190825"><span class="hs-identifier hs-var">do_pass</span></a></span><span> </span><span id="local-6989586621681190812"><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190812"><span class="hs-identifier hs-var">guts</span></a></span></span><span> </span><span id="local-6989586621681190811"><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190811"><span class="hs-identifier hs-var">pass</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-418"></span><span>       </span><span class="annot"><span class="annottext">SDoc -&gt; (ModGuts -&gt; ()) -&gt; CoreM ModGuts -&gt; CoreM ModGuts
forall (m :: * -&gt; *) a.
(MonadIO m, HasDynFlags m) =&gt;
SDoc -&gt; (a -&gt; ()) -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Error.html#withTimingD"><span class="hs-identifier hs-var">withTimingD</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreToDo -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190811"><span class="hs-identifier hs-var">pass</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#brackets"><span class="hs-identifier hs-var">brackets</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681190807"><span class="hs-identifier hs-var">mod</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-419"></span><span>                   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; ModGuts -&gt; ()
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(CoreM ModGuts -&gt; CoreM ModGuts) -&gt; CoreM ModGuts -&gt; CoreM ModGuts
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-420"></span><span>            </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681190805"><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190805"><span class="hs-identifier hs-var">guts'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; (ModGuts -&gt; CoreM ModGuts) -&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Lint.html#lintAnnots"><span class="hs-identifier hs-var">lintAnnots</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreToDo -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190811"><span class="hs-identifier hs-var">pass</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreToDo -&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190811"><span class="hs-identifier hs-var">pass</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190812"><span class="hs-identifier hs-var">guts</span></a></span><span>
</span><span id="line-421"></span><span>            </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CoreToDo -&gt; CoreProgram -&gt; [CoreRule] -&gt; CoreM ()
</span><a href="GHC.Core.Lint.html#endPass"><span class="hs-identifier hs-var">endPass</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190811"><span class="hs-identifier hs-var">pass</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModGuts -&gt; CoreProgram
</span><a href="GHC.Driver.Types.html#mg_binds"><span class="hs-identifier hs-var hs-var">mg_binds</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190805"><span class="hs-identifier hs-var">guts'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModGuts -&gt; [CoreRule]
</span><a href="GHC.Driver.Types.html#mg_rules"><span class="hs-identifier hs-var hs-var">mg_rules</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190805"><span class="hs-identifier hs-var">guts'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-422"></span><span>            </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">ModGuts -&gt; CoreM ModGuts
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190805"><span class="hs-identifier hs-var">guts'</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-423"></span><span>
</span><span id="line-424"></span><span>    </span><span id="local-6989586621681190807"><span class="annot"><span class="annottext">mod :: Module
</span><a href="#local-6989586621681190807"><span class="hs-identifier hs-var hs-var">mod</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModGuts -&gt; Module
</span><a href="GHC.Driver.Types.html#mg_module"><span class="hs-identifier hs-var hs-var">mg_module</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190827"><span class="hs-identifier hs-var">guts</span></a></span><span>
</span><span id="line-425"></span><span>
</span><span id="line-426"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-type">doCorePass</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreToDo"><span class="hs-identifier hs-type">CoreToDo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreM"><span class="hs-identifier hs-type">CoreM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span>
</span><span id="line-427"></span><span id="doCorePass"><span class="annot"><span class="annottext">doCorePass :: CoreToDo -&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var hs-var">doCorePass</span></a></span></span><span> </span><span id="local-6989586621681190801"><span class="annot"><span class="annottext">pass :: CoreToDo
</span><a href="#local-6989586621681190801"><span class="hs-identifier hs-var">pass</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreDoSimplify"><span class="hs-identifier hs-type">CoreDoSimplify</span></a></span><span> </span><span class="hs-special">{</span><span class="hs-special">}</span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;Simplify&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-428"></span><span>                                       </span><span class="annot"><span class="annottext">CoreToDo -&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#simplifyPgm"><span class="hs-identifier hs-var">simplifyPgm</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190801"><span class="hs-identifier hs-var">pass</span></a></span><span>
</span><span id="line-429"></span><span>
</span><span id="line-430"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreCSE"><span class="hs-identifier hs-var">CoreCSE</span></a></span><span>                   </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;CommonSubExpr&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-431"></span><span>                                       </span><span class="annot"><span class="annottext">(CoreProgram -&gt; CoreProgram) -&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPass"><span class="hs-identifier hs-var">doPass</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram -&gt; CoreProgram
</span><a href="GHC.Core.Opt.CSE.html#cseProgram"><span class="hs-identifier hs-var">cseProgram</span></a></span><span>
</span><span id="line-432"></span><span>
</span><span id="line-433"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreLiberateCase"><span class="hs-identifier hs-var">CoreLiberateCase</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;LiberateCase&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-434"></span><span>                                       </span><span class="annot"><span class="annottext">(DynFlags -&gt; CoreProgram -&gt; CoreProgram)
-&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassD"><span class="hs-identifier hs-var">doPassD</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; CoreProgram -&gt; CoreProgram
</span><a href="GHC.Core.Opt.LiberateCase.html#liberateCase"><span class="hs-identifier hs-var">liberateCase</span></a></span><span>
</span><span id="line-435"></span><span>
</span><span id="line-436"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoFloatInwards"><span class="hs-identifier hs-var">CoreDoFloatInwards</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;FloatInwards&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-437"></span><span>                                       </span><span class="annot"><span class="annottext">ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.FloatIn.html#floatInwards"><span class="hs-identifier hs-var">floatInwards</span></a></span><span>
</span><span id="line-438"></span><span>
</span><span id="line-439"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreDoFloatOutwards"><span class="hs-identifier hs-type">CoreDoFloatOutwards</span></a></span><span> </span><span id="local-6989586621681190797"><span class="annot"><span class="annottext">FloatOutSwitches
</span><a href="#local-6989586621681190797"><span class="hs-identifier hs-var">f</span></a></span></span><span class="hs-special">)</span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;FloatOutwards&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-440"></span><span>                                       </span><span class="annot"><span class="annottext">(DynFlags -&gt; UniqSupply -&gt; CoreProgram -&gt; IO CoreProgram)
-&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassDUM"><span class="hs-identifier hs-var">doPassDUM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FloatOutSwitches
-&gt; DynFlags -&gt; UniqSupply -&gt; CoreProgram -&gt; IO CoreProgram
</span><a href="GHC.Core.Opt.FloatOut.html#floatOutwards"><span class="hs-identifier hs-var">floatOutwards</span></a></span><span> </span><span class="annot"><span class="annottext">FloatOutSwitches
</span><a href="#local-6989586621681190797"><span class="hs-identifier hs-var">f</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-441"></span><span>
</span><span id="line-442"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoStaticArgs"><span class="hs-identifier hs-var">CoreDoStaticArgs</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;StaticArgs&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-443"></span><span>                                       </span><span class="annot"><span class="annottext">(UniqSupply -&gt; CoreProgram -&gt; CoreProgram)
-&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassU"><span class="hs-identifier hs-var">doPassU</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; CoreProgram -&gt; CoreProgram
</span><a href="GHC.Core.Opt.StaticArgs.html#doStaticArgs"><span class="hs-identifier hs-var">doStaticArgs</span></a></span><span>
</span><span id="line-444"></span><span>
</span><span id="line-445"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoCallArity"><span class="hs-identifier hs-var">CoreDoCallArity</span></a></span><span>           </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;CallArity&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-446"></span><span>                                       </span><span class="annot"><span class="annottext">(DynFlags -&gt; CoreProgram -&gt; CoreProgram)
-&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassD"><span class="hs-identifier hs-var">doPassD</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; CoreProgram -&gt; CoreProgram
</span><a href="GHC.Core.Opt.CallArity.html#callArityAnalProgram"><span class="hs-identifier hs-var">callArityAnalProgram</span></a></span><span>
</span><span id="line-447"></span><span>
</span><span id="line-448"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoExitify"><span class="hs-identifier hs-var">CoreDoExitify</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;Exitify&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-449"></span><span>                                       </span><span class="annot"><span class="annottext">(CoreProgram -&gt; CoreProgram) -&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPass"><span class="hs-identifier hs-var">doPass</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram -&gt; CoreProgram
</span><a href="GHC.Core.Opt.Exitify.html#exitifyProgram"><span class="hs-identifier hs-var">exitifyProgram</span></a></span><span>
</span><span id="line-450"></span><span>
</span><span id="line-451"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoDemand"><span class="hs-identifier hs-var">CoreDoDemand</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;DmdAnal&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-452"></span><span>                                       </span><span class="annot"><span class="annottext">(DynFlags -&gt; FamInstEnvs -&gt; CoreProgram -&gt; IO CoreProgram)
-&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassDFM"><span class="hs-identifier hs-var">doPassDFM</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; FamInstEnvs -&gt; CoreProgram -&gt; IO CoreProgram
</span><a href="GHC.Core.Opt.DmdAnal.html#dmdAnalProgram"><span class="hs-identifier hs-var">dmdAnalProgram</span></a></span><span>
</span><span id="line-453"></span><span>
</span><span id="line-454"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoCpr"><span class="hs-identifier hs-var">CoreDoCpr</span></a></span><span>                 </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;CprAnal&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-455"></span><span>                                       </span><span class="annot"><span class="annottext">(DynFlags -&gt; FamInstEnvs -&gt; CoreProgram -&gt; IO CoreProgram)
-&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassDFM"><span class="hs-identifier hs-var">doPassDFM</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; FamInstEnvs -&gt; CoreProgram -&gt; IO CoreProgram
</span><a href="GHC.Core.Opt.CprAnal.html#cprAnalProgram"><span class="hs-identifier hs-var">cprAnalProgram</span></a></span><span>
</span><span id="line-456"></span><span>
</span><span id="line-457"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoWorkerWrapper"><span class="hs-identifier hs-var">CoreDoWorkerWrapper</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;WorkWrap&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-458"></span><span>                                       </span><span class="annot"><span class="annottext">(DynFlags
 -&gt; FamInstEnvs -&gt; UniqSupply -&gt; CoreProgram -&gt; CoreProgram)
-&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassDFU"><span class="hs-identifier hs-var">doPassDFU</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; FamInstEnvs -&gt; UniqSupply -&gt; CoreProgram -&gt; CoreProgram
</span><a href="GHC.Core.Opt.WorkWrap.html#wwTopBinds"><span class="hs-identifier hs-var">wwTopBinds</span></a></span><span>
</span><span id="line-459"></span><span>
</span><span id="line-460"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoSpecialising"><span class="hs-identifier hs-var">CoreDoSpecialising</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;Specialise&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-461"></span><span>                                       </span><span class="annot"><span class="annottext">ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Specialise.html#specProgram"><span class="hs-identifier hs-var">specProgram</span></a></span><span>
</span><span id="line-462"></span><span>
</span><span id="line-463"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoSpecConstr"><span class="hs-identifier hs-var">CoreDoSpecConstr</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;SpecConstr&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-464"></span><span>                                       </span><span class="annot"><span class="annottext">ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.SpecConstr.html#specConstrProgram"><span class="hs-identifier hs-var">specConstrProgram</span></a></span><span>
</span><span id="line-465"></span><span>
</span><span id="line-466"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoPrintCore"><span class="hs-identifier hs-var">CoreDoPrintCore</span></a></span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(DynFlags -&gt; CoreProgram -&gt; IO ()) -&gt; ModGuts -&gt; CoreM ModGuts
forall a.
(DynFlags -&gt; CoreProgram -&gt; IO a) -&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#observe"><span class="hs-identifier hs-var">observe</span></a></span><span>   </span><span class="annot"><span class="annottext">DynFlags -&gt; CoreProgram -&gt; IO ()
</span><a href="GHC.Core.Opt.Pipeline.html#printCore"><span class="hs-identifier hs-var">printCore</span></a></span><span>
</span><span id="line-467"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreDoRuleCheck"><span class="hs-identifier hs-type">CoreDoRuleCheck</span></a></span><span> </span><span id="local-6989586621681190789"><span class="annot"><span class="annottext">CompilerPhase
</span><a href="#local-6989586621681190789"><span class="hs-identifier hs-var">phase</span></a></span></span><span> </span><span id="local-6989586621681190788"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681190788"><span class="hs-identifier hs-var">pat</span></a></span></span><span class="hs-special">)</span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CompilerPhase -&gt; String -&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#ruleCheckPass"><span class="hs-identifier hs-var">ruleCheckPass</span></a></span><span> </span><span class="annot"><span class="annottext">CompilerPhase
</span><a href="#local-6989586621681190789"><span class="hs-identifier hs-var">phase</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681190788"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-468"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDoNothing"><span class="hs-identifier hs-var">CoreDoNothing</span></a></span><span>                </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModGuts -&gt; CoreM ModGuts
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span>
</span><span id="line-469"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreDoPasses"><span class="hs-identifier hs-type">CoreDoPasses</span></a></span><span> </span><span id="local-6989586621681190786"><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190786"><span class="hs-identifier hs-var">passes</span></a></span></span><span class="hs-special">)</span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreToDo] -&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#runCorePasses"><span class="hs-identifier hs-var">runCorePasses</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreToDo]
</span><a href="#local-6989586621681190786"><span class="hs-identifier hs-var">passes</span></a></span><span>
</span><span id="line-470"></span><span>
</span><span id="line-471"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreDoPluginPass"><span class="hs-identifier hs-type">CoreDoPluginPass</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-identifier">_</span></span><span> </span><span id="local-6989586621681190784"><span class="annot"><span class="annottext">ModGuts -&gt; CoreM ModGuts
</span><a href="#local-6989586621681190784"><span class="hs-identifier hs-var">pass</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;Plugin&quot;</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><span class="annottext">ModGuts -&gt; CoreM ModGuts
</span><a href="#local-6989586621681190784"><span class="hs-identifier hs-var">pass</span></a></span><span>
</span><span id="line-472"></span><span>
</span><span id="line-473"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span id="local-6989586621681190783"><span class="annot"><span class="annottext">pass :: CoreToDo
</span><a href="#local-6989586621681190783"><span class="hs-identifier hs-var">pass</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDesugar"><span class="hs-identifier hs-var">CoreDesugar</span></a></span><span>          </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; ModGuts -&gt; CoreM ModGuts
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;doCorePass&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreToDo -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190783"><span class="hs-identifier hs-var">pass</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-474"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span id="local-6989586621681190780"><span class="annot"><span class="annottext">pass :: CoreToDo
</span><a href="#local-6989586621681190780"><span class="hs-identifier hs-var">pass</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreDesugarOpt"><span class="hs-identifier hs-var">CoreDesugarOpt</span></a></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; ModGuts -&gt; CoreM ModGuts
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;doCorePass&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreToDo -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190780"><span class="hs-identifier hs-var">pass</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-475"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span id="local-6989586621681190778"><span class="annot"><span class="annottext">pass :: CoreToDo
</span><a href="#local-6989586621681190778"><span class="hs-identifier hs-var">pass</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreTidy"><span class="hs-identifier hs-var">CoreTidy</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; ModGuts -&gt; CoreM ModGuts
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;doCorePass&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreToDo -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190778"><span class="hs-identifier hs-var">pass</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-476"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span id="local-6989586621681190776"><span class="annot"><span class="annottext">pass :: CoreToDo
</span><a href="#local-6989586621681190776"><span class="hs-identifier hs-var">pass</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CorePrep"><span class="hs-identifier hs-var">CorePrep</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; ModGuts -&gt; CoreM ModGuts
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;doCorePass&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreToDo -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190776"><span class="hs-identifier hs-var">pass</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-477"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doCorePass"><span class="hs-identifier hs-var">doCorePass</span></a></span><span> </span><span id="local-6989586621681190774"><span class="annot"><span class="annottext">pass :: CoreToDo
</span><a href="#local-6989586621681190774"><span class="hs-identifier hs-var">pass</span></a></span></span><span class="hs-glyph">@</span><span class="annot"><span class="annottext">CoreToDo
</span><a href="GHC.Core.Opt.Monad.html#CoreOccurAnal"><span class="hs-identifier hs-var">CoreOccurAnal</span></a></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; ModGuts -&gt; CoreM ModGuts
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;doCorePass&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreToDo -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190774"><span class="hs-identifier hs-var">pass</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-478"></span><span>
</span><span id="line-479"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{Core pass combinators}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-486"></span><span>
</span><span id="line-487"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#printCore"><span class="hs-identifier hs-type">printCore</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-488"></span><span id="printCore"><span class="annot"><span class="annottext">printCore :: DynFlags -&gt; CoreProgram -&gt; IO ()
</span><a href="GHC.Core.Opt.Pipeline.html#printCore"><span class="hs-identifier hs-var hs-var">printCore</span></a></span></span><span> </span><span id="local-6989586621681190772"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190772"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681190771"><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190771"><span class="hs-identifier hs-var">binds</span></a></span></span><span>
</span><span id="line-489"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Bool -&gt; String -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet"><span class="hs-identifier hs-var">Err.dumpIfSet</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190772"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Print Core&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreProgram -&gt; SDoc
forall b. OutputableBndr b =&gt; [Bind b] -&gt; SDoc
</span><a href="GHC.Core.Ppr.html#pprCoreBindings"><span class="hs-identifier hs-var">pprCoreBindings</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190771"><span class="hs-identifier hs-var">binds</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-490"></span><span>
</span><span id="line-491"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#ruleCheckPass"><span class="hs-identifier hs-type">ruleCheckPass</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Basic.html#CompilerPhase"><span class="hs-identifier hs-type">CompilerPhase</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreM"><span class="hs-identifier hs-type">CoreM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span>
</span><span id="line-492"></span><span id="ruleCheckPass"><span class="annot"><span class="annottext">ruleCheckPass :: CompilerPhase -&gt; String -&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#ruleCheckPass"><span class="hs-identifier hs-var hs-var">ruleCheckPass</span></a></span></span><span> </span><span id="local-6989586621681190769"><span class="annot"><span class="annottext">CompilerPhase
</span><a href="#local-6989586621681190769"><span class="hs-identifier hs-var">current_phase</span></a></span></span><span> </span><span id="local-6989586621681190768"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681190768"><span class="hs-identifier hs-var">pat</span></a></span></span><span> </span><span id="local-6989586621681190767"><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190767"><span class="hs-identifier hs-var">guts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-493"></span><span>    </span><span class="annot"><span class="annottext">SDoc -&gt; (ModGuts -&gt; ()) -&gt; CoreM ModGuts -&gt; CoreM ModGuts
forall (m :: * -&gt; *) a.
(MonadIO m, HasDynFlags m) =&gt;
SDoc -&gt; (a -&gt; ()) -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Error.html#withTimingD"><span class="hs-identifier hs-var">withTimingD</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;RuleCheck&quot;</span></span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span class="annot"><span class="annottext">SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#brackets"><span class="hs-identifier hs-var">brackets</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Module -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">(Module -&gt; SDoc) -&gt; Module -&gt; SDoc
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts -&gt; Module
</span><a href="GHC.Driver.Types.html#mg_module"><span class="hs-identifier hs-var hs-var">mg_module</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190767"><span class="hs-identifier hs-var">guts</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-494"></span><span>                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; ModGuts -&gt; ()
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(CoreM ModGuts -&gt; CoreM ModGuts) -&gt; CoreM ModGuts -&gt; CoreM ModGuts
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-495"></span><span>    </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681190765"><span class="annot"><span class="annottext">RuleBase
</span><a href="#local-6989586621681190765"><span class="hs-identifier hs-var">rb</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreM RuleBase
</span><a href="GHC.Core.Opt.Monad.html#getRuleBase"><span class="hs-identifier hs-var">getRuleBase</span></a></span><span>
</span><span id="line-496"></span><span>    </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681190763"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190763"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreM DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-497"></span><span>    </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681190761"><span class="annot"><span class="annottext">ModuleSet
</span><a href="#local-6989586621681190761"><span class="hs-identifier hs-var">vis_orphs</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreM ModuleSet
</span><a href="GHC.Core.Opt.Monad.html#getVisibleOrphanMods"><span class="hs-identifier hs-var">getVisibleOrphanMods</span></a></span><span>
</span><span id="line-498"></span><span>    </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681190759"><span class="annot"><span class="annottext">rule_fn :: Id -&gt; [CoreRule]
</span><a href="#local-6989586621681190759"><span class="hs-identifier hs-var hs-var">rule_fn</span></a></span></span><span> </span><span id="local-6989586621681190758"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190758"><span class="hs-identifier hs-var">fn</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RuleEnv -&gt; Id -&gt; [CoreRule]
</span><a href="GHC.Core.Rules.html#getRules"><span class="hs-identifier hs-var">getRules</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RuleBase -&gt; ModuleSet -&gt; RuleEnv
</span><a href="GHC.Core.html#RuleEnv"><span class="hs-identifier hs-var">RuleEnv</span></a></span><span> </span><span class="annot"><span class="annottext">RuleBase
</span><a href="#local-6989586621681190765"><span class="hs-identifier hs-var">rb</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleSet
</span><a href="#local-6989586621681190761"><span class="hs-identifier hs-var">vis_orphs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190758"><span class="hs-identifier hs-var">fn</span></a></span><span>
</span><span id="line-499"></span><span>                        </span><span class="annot"><span class="annottext">[CoreRule] -&gt; [CoreRule] -&gt; [CoreRule]
forall a. [a] -&gt; [a] -&gt; [a]
</span><a href="../../base/src/GHC.Base.html#%2B%2B"><span class="hs-operator hs-var">++</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModGuts -&gt; [CoreRule]
</span><a href="GHC.Driver.Types.html#mg_rules"><span class="hs-identifier hs-var hs-var">mg_rules</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190767"><span class="hs-identifier hs-var">guts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-500"></span><span>    </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681190756"><span class="annot"><span class="annottext">ropts :: RuleOpts
</span><a href="#local-6989586621681190756"><span class="hs-identifier hs-var hs-var">ropts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; RuleOpts
</span><a href="GHC.Core.Rules.html#initRuleOpts"><span class="hs-identifier hs-var">initRuleOpts</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190763"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-501"></span><span>    </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">IO () -&gt; CoreM ()
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO () -&gt; CoreM ()) -&gt; IO () -&gt; CoreM ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; WarnReason -&gt; Severity -&gt; SrcSpan -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Driver.Session.html#putLogMsg"><span class="hs-identifier hs-var">putLogMsg</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190763"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">WarnReason
</span><a href="GHC.Driver.Flags.html#NoReason"><span class="hs-identifier hs-var">NoReason</span></a></span><span> </span><span class="annot"><span class="annottext">Severity
</span><a href="GHC.Utils.Error.html#SevDump"><span class="hs-identifier hs-var">Err.SevDump</span></a></span><span> </span><span class="annot"><span class="annottext">SrcSpan
</span><a href="GHC.Types.SrcLoc.html#noSrcSpan"><span class="hs-identifier hs-var">noSrcSpan</span></a></span><span>
</span><span id="line-502"></span><span>                   </span><span class="annot"><span class="annottext">(SDoc -&gt; IO ()) -&gt; SDoc -&gt; IO ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#withPprStyle"><span class="hs-identifier hs-var">withPprStyle</span></a></span><span> </span><span class="annot"><span class="annottext">PprStyle
</span><a href="GHC.Utils.Outputable.html#defaultDumpStyle"><span class="hs-identifier hs-var">defaultDumpStyle</span></a></span><span>
</span><span id="line-503"></span><span>                   </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RuleOpts
-&gt; CompilerPhase
-&gt; String
-&gt; (Id -&gt; [CoreRule])
-&gt; CoreProgram
-&gt; SDoc
</span><a href="GHC.Core.Rules.html#ruleCheckProgram"><span class="hs-identifier hs-var">ruleCheckProgram</span></a></span><span> </span><span class="annot"><span class="annottext">RuleOpts
</span><a href="#local-6989586621681190756"><span class="hs-identifier hs-var">ropts</span></a></span><span> </span><span class="annot"><span class="annottext">CompilerPhase
</span><a href="#local-6989586621681190769"><span class="hs-identifier hs-var">current_phase</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681190768"><span class="hs-identifier hs-var">pat</span></a></span><span>
</span><span id="line-504"></span><span>                      </span><span class="annot"><span class="annottext">Id -&gt; [CoreRule]
</span><a href="#local-6989586621681190759"><span class="hs-identifier hs-var">rule_fn</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModGuts -&gt; CoreProgram
</span><a href="GHC.Driver.Types.html#mg_binds"><span class="hs-identifier hs-var hs-var">mg_binds</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190767"><span class="hs-identifier hs-var">guts</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-505"></span><span>    </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">ModGuts -&gt; CoreM ModGuts
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190767"><span class="hs-identifier hs-var">guts</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-506"></span><span>
</span><span id="line-507"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doPassDUM"><span class="hs-identifier hs-type">doPassDUM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSupply"><span class="hs-identifier hs-type">UniqSupply</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreM"><span class="hs-identifier hs-type">CoreM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span>
</span><span id="line-508"></span><span id="doPassDUM"><span class="annot"><span class="annottext">doPassDUM :: (DynFlags -&gt; UniqSupply -&gt; CoreProgram -&gt; IO CoreProgram)
-&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassDUM"><span class="hs-identifier hs-var hs-var">doPassDUM</span></a></span></span><span> </span><span id="local-6989586621681190749"><span class="annot"><span class="annottext">DynFlags -&gt; UniqSupply -&gt; CoreProgram -&gt; IO CoreProgram
</span><a href="#local-6989586621681190749"><span class="hs-identifier hs-var">do_pass</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CoreProgram -&gt; CoreM CoreProgram) -&gt; ModGuts -&gt; CoreM ModGuts
forall (m :: * -&gt; *).
Monad m =&gt;
(CoreProgram -&gt; m CoreProgram) -&gt; ModGuts -&gt; m ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassM"><span class="hs-identifier hs-var">doPassM</span></a></span><span> </span><span class="annot"><span class="annottext">((CoreProgram -&gt; CoreM CoreProgram) -&gt; ModGuts -&gt; CoreM ModGuts)
-&gt; (CoreProgram -&gt; CoreM CoreProgram) -&gt; ModGuts -&gt; CoreM ModGuts
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681190747"><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190747"><span class="hs-identifier hs-var">binds</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-509"></span><span>    </span><span id="local-6989586621681190746"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190746"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreM DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-510"></span><span>    </span><span id="local-6989586621681190745"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190745"><span class="hs-identifier hs-var">us</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreM UniqSupply
forall (m :: * -&gt; *). MonadUnique m =&gt; m UniqSupply
</span><a href="GHC.Types.Unique.Supply.html#getUniqueSupplyM"><span class="hs-identifier hs-var">getUniqueSupplyM</span></a></span><span>
</span><span id="line-511"></span><span>    </span><span class="annot"><span class="annottext">IO CoreProgram -&gt; CoreM CoreProgram
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO CoreProgram -&gt; CoreM CoreProgram)
-&gt; IO CoreProgram -&gt; CoreM CoreProgram
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; UniqSupply -&gt; CoreProgram -&gt; IO CoreProgram
</span><a href="#local-6989586621681190749"><span class="hs-identifier hs-var">do_pass</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190746"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190745"><span class="hs-identifier hs-var">us</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190747"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-512"></span><span>
</span><span id="line-513"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doPassDM"><span class="hs-identifier hs-type">doPassDM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreM"><span class="hs-identifier hs-type">CoreM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span>
</span><span id="line-514"></span><span id="doPassDM"><span class="annot"><span class="annottext">doPassDM :: (DynFlags -&gt; CoreProgram -&gt; IO CoreProgram)
-&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassDM"><span class="hs-identifier hs-var hs-var">doPassDM</span></a></span></span><span> </span><span id="local-6989586621681190742"><span class="annot"><span class="annottext">DynFlags -&gt; CoreProgram -&gt; IO CoreProgram
</span><a href="#local-6989586621681190742"><span class="hs-identifier hs-var">do_pass</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(DynFlags -&gt; UniqSupply -&gt; CoreProgram -&gt; IO CoreProgram)
-&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassDUM"><span class="hs-identifier hs-var">doPassDUM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681190741"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190741"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">(CoreProgram -&gt; IO CoreProgram)
-&gt; UniqSupply -&gt; CoreProgram -&gt; IO CoreProgram
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; CoreProgram -&gt; IO CoreProgram
</span><a href="#local-6989586621681190742"><span class="hs-identifier hs-var">do_pass</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190741"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-515"></span><span>
</span><span id="line-516"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doPassD"><span class="hs-identifier hs-type">doPassD</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreM"><span class="hs-identifier hs-type">CoreM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span>
</span><span id="line-517"></span><span id="doPassD"><span class="annot"><span class="annottext">doPassD :: (DynFlags -&gt; CoreProgram -&gt; CoreProgram)
-&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassD"><span class="hs-identifier hs-var hs-var">doPassD</span></a></span></span><span> </span><span id="local-6989586621681190740"><span class="annot"><span class="annottext">DynFlags -&gt; CoreProgram -&gt; CoreProgram
</span><a href="#local-6989586621681190740"><span class="hs-identifier hs-var">do_pass</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(DynFlags -&gt; CoreProgram -&gt; IO CoreProgram)
-&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassDM"><span class="hs-identifier hs-var">doPassDM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681190739"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190739"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreProgram -&gt; IO CoreProgram
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreProgram -&gt; IO CoreProgram)
-&gt; (CoreProgram -&gt; CoreProgram) -&gt; CoreProgram -&gt; IO CoreProgram
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; CoreProgram -&gt; CoreProgram
</span><a href="#local-6989586621681190740"><span class="hs-identifier hs-var">do_pass</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190739"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-518"></span><span>
</span><span id="line-519"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doPassDU"><span class="hs-identifier hs-type">doPassDU</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSupply"><span class="hs-identifier hs-type">UniqSupply</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreM"><span class="hs-identifier hs-type">CoreM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span>
</span><span id="line-520"></span><span id="doPassDU"><span class="annot"><span class="annottext">doPassDU :: (DynFlags -&gt; UniqSupply -&gt; CoreProgram -&gt; CoreProgram)
-&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassDU"><span class="hs-identifier hs-var hs-var">doPassDU</span></a></span></span><span> </span><span id="local-6989586621681190736"><span class="annot"><span class="annottext">DynFlags -&gt; UniqSupply -&gt; CoreProgram -&gt; CoreProgram
</span><a href="#local-6989586621681190736"><span class="hs-identifier hs-var">do_pass</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(DynFlags -&gt; UniqSupply -&gt; CoreProgram -&gt; IO CoreProgram)
-&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassDUM"><span class="hs-identifier hs-var">doPassDUM</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681190735"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190735"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681190734"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190734"><span class="hs-identifier hs-var">us</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">CoreProgram -&gt; IO CoreProgram
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(CoreProgram -&gt; IO CoreProgram)
-&gt; (CoreProgram -&gt; CoreProgram) -&gt; CoreProgram -&gt; IO CoreProgram
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; UniqSupply -&gt; CoreProgram -&gt; CoreProgram
</span><a href="#local-6989586621681190736"><span class="hs-identifier hs-var">do_pass</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190735"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190734"><span class="hs-identifier hs-var">us</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-521"></span><span>
</span><span id="line-522"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doPassU"><span class="hs-identifier hs-type">doPassU</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSupply"><span class="hs-identifier hs-type">UniqSupply</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreM"><span class="hs-identifier hs-type">CoreM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span>
</span><span id="line-523"></span><span id="doPassU"><span class="annot"><span class="annottext">doPassU :: (UniqSupply -&gt; CoreProgram -&gt; CoreProgram)
-&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassU"><span class="hs-identifier hs-var hs-var">doPassU</span></a></span></span><span> </span><span id="local-6989586621681190733"><span class="annot"><span class="annottext">UniqSupply -&gt; CoreProgram -&gt; CoreProgram
</span><a href="#local-6989586621681190733"><span class="hs-identifier hs-var">do_pass</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(DynFlags -&gt; UniqSupply -&gt; CoreProgram -&gt; CoreProgram)
-&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassDU"><span class="hs-identifier hs-var">doPassDU</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">(UniqSupply -&gt; CoreProgram -&gt; CoreProgram)
-&gt; DynFlags -&gt; UniqSupply -&gt; CoreProgram -&gt; CoreProgram
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; CoreProgram -&gt; CoreProgram
</span><a href="#local-6989586621681190733"><span class="hs-identifier hs-var">do_pass</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-524"></span><span>
</span><span id="line-525"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doPassDFM"><span class="hs-identifier hs-type">doPassDFM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.FamInstEnv.html#FamInstEnvs"><span class="hs-identifier hs-type">FamInstEnvs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreM"><span class="hs-identifier hs-type">CoreM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span>
</span><span id="line-526"></span><span id="doPassDFM"><span class="annot"><span class="annottext">doPassDFM :: (DynFlags -&gt; FamInstEnvs -&gt; CoreProgram -&gt; IO CoreProgram)
-&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassDFM"><span class="hs-identifier hs-var hs-var">doPassDFM</span></a></span></span><span> </span><span id="local-6989586621681190732"><span class="annot"><span class="annottext">DynFlags -&gt; FamInstEnvs -&gt; CoreProgram -&gt; IO CoreProgram
</span><a href="#local-6989586621681190732"><span class="hs-identifier hs-var">do_pass</span></a></span></span><span> </span><span id="local-6989586621681190731"><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190731"><span class="hs-identifier hs-var">guts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-527"></span><span>    </span><span id="local-6989586621681190730"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190730"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreM DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-528"></span><span>    </span><span id="local-6989586621681190729"><span class="annot"><span class="annottext">PackageFamInstEnv
</span><a href="#local-6989586621681190729"><span class="hs-identifier hs-var">p_fam_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreM PackageFamInstEnv
</span><a href="GHC.Core.Opt.Monad.html#getPackageFamInstEnv"><span class="hs-identifier hs-var">getPackageFamInstEnv</span></a></span><span>
</span><span id="line-529"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681190727"><span class="annot"><span class="annottext">fam_envs :: FamInstEnvs
</span><a href="#local-6989586621681190727"><span class="hs-identifier hs-var hs-var">fam_envs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PackageFamInstEnv
</span><a href="#local-6989586621681190729"><span class="hs-identifier hs-var">p_fam_env</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModGuts -&gt; PackageFamInstEnv
</span><a href="GHC.Driver.Types.html#mg_fam_inst_env"><span class="hs-identifier hs-var hs-var">mg_fam_inst_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190731"><span class="hs-identifier hs-var">guts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-530"></span><span>    </span><span class="annot"><span class="annottext">(CoreProgram -&gt; CoreM CoreProgram) -&gt; ModGuts -&gt; CoreM ModGuts
forall (m :: * -&gt; *).
Monad m =&gt;
(CoreProgram -&gt; m CoreProgram) -&gt; ModGuts -&gt; m ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassM"><span class="hs-identifier hs-var">doPassM</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IO CoreProgram -&gt; CoreM CoreProgram
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO CoreProgram -&gt; CoreM CoreProgram)
-&gt; (CoreProgram -&gt; IO CoreProgram)
-&gt; CoreProgram
-&gt; CoreM CoreProgram
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; FamInstEnvs -&gt; CoreProgram -&gt; IO CoreProgram
</span><a href="#local-6989586621681190732"><span class="hs-identifier hs-var">do_pass</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190730"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">FamInstEnvs
</span><a href="#local-6989586621681190727"><span class="hs-identifier hs-var">fam_envs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190731"><span class="hs-identifier hs-var">guts</span></a></span><span>
</span><span id="line-531"></span><span>
</span><span id="line-532"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doPassDFU"><span class="hs-identifier hs-type">doPassDFU</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.FamInstEnv.html#FamInstEnvs"><span class="hs-identifier hs-type">FamInstEnvs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSupply"><span class="hs-identifier hs-type">UniqSupply</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreM"><span class="hs-identifier hs-type">CoreM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span>
</span><span id="line-533"></span><span id="doPassDFU"><span class="annot"><span class="annottext">doPassDFU :: (DynFlags
 -&gt; FamInstEnvs -&gt; UniqSupply -&gt; CoreProgram -&gt; CoreProgram)
-&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassDFU"><span class="hs-identifier hs-var hs-var">doPassDFU</span></a></span></span><span> </span><span id="local-6989586621681190725"><span class="annot"><span class="annottext">DynFlags -&gt; FamInstEnvs -&gt; UniqSupply -&gt; CoreProgram -&gt; CoreProgram
</span><a href="#local-6989586621681190725"><span class="hs-identifier hs-var">do_pass</span></a></span></span><span> </span><span id="local-6989586621681190724"><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190724"><span class="hs-identifier hs-var">guts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-534"></span><span>    </span><span id="local-6989586621681190723"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190723"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreM DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-535"></span><span>    </span><span id="local-6989586621681190722"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190722"><span class="hs-identifier hs-var">us</span></a></span></span><span>     </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreM UniqSupply
forall (m :: * -&gt; *). MonadUnique m =&gt; m UniqSupply
</span><a href="GHC.Types.Unique.Supply.html#getUniqueSupplyM"><span class="hs-identifier hs-var">getUniqueSupplyM</span></a></span><span>
</span><span id="line-536"></span><span>    </span><span id="local-6989586621681190721"><span class="annot"><span class="annottext">PackageFamInstEnv
</span><a href="#local-6989586621681190721"><span class="hs-identifier hs-var">p_fam_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreM PackageFamInstEnv
</span><a href="GHC.Core.Opt.Monad.html#getPackageFamInstEnv"><span class="hs-identifier hs-var">getPackageFamInstEnv</span></a></span><span>
</span><span id="line-537"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681190720"><span class="annot"><span class="annottext">fam_envs :: FamInstEnvs
</span><a href="#local-6989586621681190720"><span class="hs-identifier hs-var hs-var">fam_envs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">PackageFamInstEnv
</span><a href="#local-6989586621681190721"><span class="hs-identifier hs-var">p_fam_env</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModGuts -&gt; PackageFamInstEnv
</span><a href="GHC.Driver.Types.html#mg_fam_inst_env"><span class="hs-identifier hs-var hs-var">mg_fam_inst_env</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190724"><span class="hs-identifier hs-var">guts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-538"></span><span>    </span><span class="annot"><span class="annottext">(CoreProgram -&gt; CoreProgram) -&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPass"><span class="hs-identifier hs-var">doPass</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; FamInstEnvs -&gt; UniqSupply -&gt; CoreProgram -&gt; CoreProgram
</span><a href="#local-6989586621681190725"><span class="hs-identifier hs-var">do_pass</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190723"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">FamInstEnvs
</span><a href="#local-6989586621681190720"><span class="hs-identifier hs-var">fam_envs</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190722"><span class="hs-identifier hs-var">us</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190724"><span class="hs-identifier hs-var">guts</span></a></span><span>
</span><span id="line-539"></span><span>
</span><span id="line-540"></span><span class="hs-comment">-- Most passes return no stats and don't change rules: these combinators</span><span>
</span><span id="line-541"></span><span class="hs-comment">-- let us lift them to the full blown ModGuts+CoreM world</span><span>
</span><span id="line-542"></span><span id="local-6989586621681191218"><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doPassM"><span class="hs-identifier hs-type">doPassM</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Base.html#Monad"><span class="hs-identifier hs-type">Monad</span></a></span><span> </span><span class="annot"><a href="#local-6989586621681191218"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="hs-glyph">=&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681191218"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="#local-6989586621681191218"><span class="hs-identifier hs-type">m</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span></span><span>
</span><span id="line-543"></span><span id="doPassM"><span class="annot"><span class="annottext">doPassM :: forall (m :: * -&gt; *).
Monad m =&gt;
(CoreProgram -&gt; m CoreProgram) -&gt; ModGuts -&gt; m ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassM"><span class="hs-identifier hs-var hs-var">doPassM</span></a></span></span><span> </span><span id="local-6989586621681190716"><span class="annot"><span class="annottext">CoreProgram -&gt; m CoreProgram
</span><a href="#local-6989586621681190716"><span class="hs-identifier hs-var">bind_f</span></a></span></span><span> </span><span id="local-6989586621681190715"><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190715"><span class="hs-identifier hs-var">guts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-544"></span><span>    </span><span id="local-6989586621681190714"><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190714"><span class="hs-identifier hs-var">binds'</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreProgram -&gt; m CoreProgram
</span><a href="#local-6989586621681190716"><span class="hs-identifier hs-var">bind_f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModGuts -&gt; CoreProgram
</span><a href="GHC.Driver.Types.html#mg_binds"><span class="hs-identifier hs-var hs-var">mg_binds</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190715"><span class="hs-identifier hs-var">guts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-545"></span><span>    </span><span class="annot"><span class="annottext">ModGuts -&gt; m ModGuts
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190715"><span class="hs-identifier hs-var">guts</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_binds :: CoreProgram
</span><a href="GHC.Driver.Types.html#mg_binds"><span class="hs-identifier hs-var">mg_binds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190714"><span class="hs-identifier hs-var">binds'</span></a></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-546"></span><span>
</span><span id="line-547"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#doPass"><span class="hs-identifier hs-type">doPass</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreM"><span class="hs-identifier hs-type">CoreM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span>
</span><span id="line-548"></span><span id="doPass"><span class="annot"><span class="annottext">doPass :: (CoreProgram -&gt; CoreProgram) -&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPass"><span class="hs-identifier hs-var hs-var">doPass</span></a></span></span><span> </span><span id="local-6989586621681190713"><span class="annot"><span class="annottext">CoreProgram -&gt; CoreProgram
</span><a href="#local-6989586621681190713"><span class="hs-identifier hs-var">bind_f</span></a></span></span><span> </span><span id="local-6989586621681190712"><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190712"><span class="hs-identifier hs-var">guts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">ModGuts -&gt; CoreM ModGuts
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">(ModGuts -&gt; CoreM ModGuts) -&gt; ModGuts -&gt; CoreM ModGuts
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190712"><span class="hs-identifier hs-var">guts</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_binds :: CoreProgram
</span><a href="GHC.Driver.Types.html#mg_binds"><span class="hs-identifier hs-var">mg_binds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreProgram -&gt; CoreProgram
</span><a href="#local-6989586621681190713"><span class="hs-identifier hs-var">bind_f</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ModGuts -&gt; CoreProgram
</span><a href="GHC.Driver.Types.html#mg_binds"><span class="hs-identifier hs-var hs-var">mg_binds</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190712"><span class="hs-identifier hs-var">guts</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-549"></span><span>
</span><span id="line-550"></span><span class="hs-comment">-- Observer passes just peek; don't modify the bindings at all</span><span>
</span><span id="line-551"></span><span id="local-6989586621681191228"><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#observe"><span class="hs-identifier hs-type">observe</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="#local-6989586621681191228"><span class="hs-identifier hs-type">a</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreM"><span class="hs-identifier hs-type">CoreM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span></span><span>
</span><span id="line-552"></span><span id="observe"><span class="annot"><span class="annottext">observe :: forall a.
(DynFlags -&gt; CoreProgram -&gt; IO a) -&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#observe"><span class="hs-identifier hs-var hs-var">observe</span></a></span></span><span> </span><span id="local-6989586621681190705"><span class="annot"><span class="annottext">DynFlags -&gt; CoreProgram -&gt; IO a
</span><a href="#local-6989586621681190705"><span class="hs-identifier hs-var">do_pass</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(CoreProgram -&gt; CoreM CoreProgram) -&gt; ModGuts -&gt; CoreM ModGuts
forall (m :: * -&gt; *).
Monad m =&gt;
(CoreProgram -&gt; m CoreProgram) -&gt; ModGuts -&gt; m ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#doPassM"><span class="hs-identifier hs-var">doPassM</span></a></span><span> </span><span class="annot"><span class="annottext">((CoreProgram -&gt; CoreM CoreProgram) -&gt; ModGuts -&gt; CoreM ModGuts)
-&gt; (CoreProgram -&gt; CoreM CoreProgram) -&gt; ModGuts -&gt; CoreM ModGuts
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-glyph">\</span><span id="local-6989586621681190704"><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190704"><span class="hs-identifier hs-var">binds</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-553"></span><span>    </span><span id="local-6989586621681190703"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190703"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreM DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-554"></span><span>    </span><span class="annot"><span class="annottext">a
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">IO a -&gt; CoreM a
forall (m :: * -&gt; *) a. MonadIO m =&gt; IO a -&gt; m a
</span><a href="../../base/src/Control.Monad.IO.Class.html#liftIO"><span class="hs-identifier hs-var">liftIO</span></a></span><span> </span><span class="annot"><span class="annottext">(IO a -&gt; CoreM a) -&gt; IO a -&gt; CoreM a
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; CoreProgram -&gt; IO a
</span><a href="#local-6989586621681190705"><span class="hs-identifier hs-var">do_pass</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190703"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190704"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-555"></span><span>    </span><span class="annot"><span class="annottext">CoreProgram -&gt; CoreM CoreProgram
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190704"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-556"></span><span>
</span><span id="line-557"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
        Gentle simplification
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-564"></span><span>
</span><span id="line-565"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#simplifyExpr"><span class="hs-identifier hs-type">simplifyExpr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span> </span><span class="hs-comment">-- includes spec of what core-to-core passes to do</span><span>
</span><span id="line-566"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-567"></span><span>             </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-568"></span><span class="hs-comment">-- simplifyExpr is called by the driver to simplify an</span><span>
</span><span id="line-569"></span><span class="hs-comment">-- expression typed in at the interactive prompt</span><span>
</span><span id="line-570"></span><span id="simplifyExpr"><span class="annot"><span class="annottext">simplifyExpr :: HscEnv -&gt; CoreExpr -&gt; IO CoreExpr
</span><a href="GHC.Core.Opt.Pipeline.html#simplifyExpr"><span class="hs-identifier hs-var hs-var">simplifyExpr</span></a></span></span><span> </span><span id="local-6989586621681190702"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190702"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681190701"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190701"><span class="hs-identifier hs-var">expr</span></a></span></span><span>
</span><span id="line-571"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; SDoc -&gt; (CoreExpr -&gt; ()) -&gt; IO CoreExpr -&gt; IO CoreExpr
forall (m :: * -&gt; *) a.
MonadIO m =&gt;
DynFlags -&gt; SDoc -&gt; (a -&gt; ()) -&gt; m a -&gt; m a
</span><a href="GHC.Utils.Error.html#withTiming"><span class="hs-identifier hs-var">withTiming</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190700"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Simplify [expr]&quot;</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">() -&gt; CoreExpr -&gt; ()
forall a b. a -&gt; b -&gt; a
</span><a href="../../base/src/GHC.Base.html#const"><span class="hs-identifier hs-var">const</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(IO CoreExpr -&gt; IO CoreExpr) -&gt; IO CoreExpr -&gt; IO CoreExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-572"></span><span>    </span><span class="hs-keyword">do</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681190699"><span class="annot"><span class="annottext">ExternalPackageState
</span><a href="#local-6989586621681190699"><span class="hs-identifier hs-var">eps</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; IO ExternalPackageState
</span><a href="GHC.Driver.Types.html#hscEPS"><span class="hs-identifier hs-var">hscEPS</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190702"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">;</span><span>
</span><span id="line-573"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681190697"><span class="annot"><span class="annottext">rule_env :: RuleEnv
</span><a href="#local-6989586621681190697"><span class="hs-identifier hs-var hs-var">rule_env</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RuleBase -&gt; [Module] -&gt; RuleEnv
</span><a href="GHC.Core.html#mkRuleEnv"><span class="hs-identifier hs-var">mkRuleEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExternalPackageState -&gt; RuleBase
</span><a href="GHC.Driver.Types.html#eps_rule_base"><span class="hs-identifier hs-var hs-var">eps_rule_base</span></a></span><span> </span><span class="annot"><span class="annottext">ExternalPackageState
</span><a href="#local-6989586621681190699"><span class="hs-identifier hs-var">eps</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-574"></span><span>              </span><span id="local-6989586621681190694"><span class="annot"><span class="annottext">fi_env :: FamInstEnvs
</span><a href="#local-6989586621681190694"><span class="hs-identifier hs-var hs-var">fi_env</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">ExternalPackageState -&gt; PackageFamInstEnv
</span><a href="GHC.Driver.Types.html#eps_fam_inst_env"><span class="hs-identifier hs-var hs-var">eps_fam_inst_env</span></a></span><span> </span><span class="annot"><span class="annottext">ExternalPackageState
</span><a href="#local-6989586621681190699"><span class="hs-identifier hs-var">eps</span></a></span><span>
</span><span id="line-575"></span><span>                          </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">PackageFamInstEnv -&gt; [FamInst] -&gt; PackageFamInstEnv
</span><a href="GHC.Core.FamInstEnv.html#extendFamInstEnvList"><span class="hs-identifier hs-var">extendFamInstEnvList</span></a></span><span> </span><span class="annot"><span class="annottext">PackageFamInstEnv
</span><a href="GHC.Core.FamInstEnv.html#emptyFamInstEnv"><span class="hs-identifier hs-var">emptyFamInstEnv</span></a></span><span> </span><span class="annot"><span class="annottext">([FamInst] -&gt; PackageFamInstEnv) -&gt; [FamInst] -&gt; PackageFamInstEnv
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-576"></span><span>                            </span><span class="annot"><span class="annottext">([ClsInst], [FamInst]) -&gt; [FamInst]
forall a b. (a, b) -&gt; b
</span><a href="../../base/src/Data.Tuple.html#snd"><span class="hs-identifier hs-var">snd</span></a></span><span> </span><span class="annot"><span class="annottext">(([ClsInst], [FamInst]) -&gt; [FamInst])
-&gt; ([ClsInst], [FamInst]) -&gt; [FamInst]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">InteractiveContext -&gt; ([ClsInst], [FamInst])
</span><a href="GHC.Driver.Types.html#ic_instances"><span class="hs-identifier hs-var hs-var">ic_instances</span></a></span><span> </span><span class="annot"><span class="annottext">(InteractiveContext -&gt; ([ClsInst], [FamInst]))
-&gt; InteractiveContext -&gt; ([ClsInst], [FamInst])
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; InteractiveContext
</span><a href="GHC.Driver.Types.html#hsc_IC"><span class="hs-identifier hs-var hs-var">hsc_IC</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190702"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-577"></span><span>              </span><span id="local-6989586621681190688"><span class="annot"><span class="annottext">simpl_env :: SimplEnv
</span><a href="#local-6989586621681190688"><span class="hs-identifier hs-var hs-var">simpl_env</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; SimplEnv
</span><a href="GHC.Core.Opt.Simplify.Utils.html#simplEnvForGHCi"><span class="hs-identifier hs-var">simplEnvForGHCi</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190700"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-578"></span><span>
</span><span id="line-579"></span><span>        </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681190687"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190687"><span class="hs-identifier hs-var">us</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span>  </span><span class="annot"><span class="annottext">Char -&gt; IO UniqSupply
</span><a href="GHC.Types.Unique.Supply.html#mkSplitUniqSupply"><span class="hs-identifier hs-var">mkSplitUniqSupply</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'s'</span></span><span>
</span><span id="line-580"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681190686"><span class="annot"><span class="annottext">sz :: Int
</span><a href="#local-6989586621681190686"><span class="hs-identifier hs-var hs-var">sz</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; Int
</span><a href="GHC.Core.Stats.html#exprSize"><span class="hs-identifier hs-var">exprSize</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190701"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-581"></span><span>
</span><span id="line-582"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681190685"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190685"><span class="hs-identifier hs-var">expr'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681190684"><span class="annot"><span class="annottext">SimplCount
</span><a href="#local-6989586621681190684"><span class="hs-identifier hs-var">counts</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; RuleEnv
-&gt; FamInstEnvs
-&gt; UniqSupply
-&gt; Int
-&gt; SimplM CoreExpr
-&gt; IO (CoreExpr, SimplCount)
forall a.
DynFlags
-&gt; RuleEnv
-&gt; FamInstEnvs
-&gt; UniqSupply
-&gt; Int
-&gt; SimplM a
-&gt; IO (a, SimplCount)
</span><a href="GHC.Core.Opt.Simplify.Monad.html#initSmpl"><span class="hs-identifier hs-var">initSmpl</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190700"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">RuleEnv
</span><a href="#local-6989586621681190697"><span class="hs-identifier hs-var">rule_env</span></a></span><span> </span><span class="annot"><span class="annottext">FamInstEnvs
</span><a href="#local-6989586621681190694"><span class="hs-identifier hs-var">fi_env</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190687"><span class="hs-identifier hs-var">us</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190686"><span class="hs-identifier hs-var">sz</span></a></span><span> </span><span class="annot"><span class="annottext">(SimplM CoreExpr -&gt; IO (CoreExpr, SimplCount))
-&gt; SimplM CoreExpr -&gt; IO (CoreExpr, SimplCount)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-583"></span><span>                             </span><span class="annot"><span class="annottext">SimplEnv -&gt; CoreExpr -&gt; SimplM CoreExpr
</span><a href="GHC.Core.Opt.Pipeline.html#simplExprGently"><span class="hs-identifier hs-var">simplExprGently</span></a></span><span> </span><span class="annot"><span class="annottext">SimplEnv
</span><a href="#local-6989586621681190688"><span class="hs-identifier hs-var">simpl_env</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190701"><span class="hs-identifier hs-var">expr</span></a></span><span>
</span><span id="line-584"></span><span>
</span><span id="line-585"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Bool -&gt; String -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet"><span class="hs-identifier hs-var">Err.dumpIfSet</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190700"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DumpFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#dopt"><span class="hs-identifier hs-var">dopt</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_simpl_stats"><span class="hs-identifier hs-var">Opt_D_dump_simpl_stats</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190700"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-586"></span><span>                  </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Simplifier statistics&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SimplCount -&gt; SDoc
</span><a href="GHC.Core.Opt.Monad.html#pprSimplCount"><span class="hs-identifier hs-var">pprSimplCount</span></a></span><span> </span><span class="annot"><span class="annottext">SimplCount
</span><a href="#local-6989586621681190684"><span class="hs-identifier hs-var">counts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-587"></span><span>
</span><span id="line-588"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; DumpFlag -&gt; String -&gt; DumpFormat -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet_dyn"><span class="hs-identifier hs-var">Err.dumpIfSet_dyn</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190700"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_simpl"><span class="hs-identifier hs-var">Opt_D_dump_simpl</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Simplified expression&quot;</span></span><span>
</span><span id="line-589"></span><span>                        </span><span class="annot"><span class="annottext">DumpFormat
</span><a href="GHC.Utils.Error.html#FormatCore"><span class="hs-identifier hs-var">FormatCore</span></a></span><span>
</span><span id="line-590"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; SDoc
forall b. OutputableBndr b =&gt; Expr b -&gt; SDoc
</span><a href="GHC.Core.Ppr.html#pprCoreExpr"><span class="hs-identifier hs-var">pprCoreExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190685"><span class="hs-identifier hs-var">expr'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-591"></span><span>
</span><span id="line-592"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CoreExpr -&gt; IO CoreExpr
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190685"><span class="hs-identifier hs-var">expr'</span></a></span><span>
</span><span id="line-593"></span><span>        </span><span class="hs-special">}</span><span>
</span><span id="line-594"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-595"></span><span>    </span><span id="local-6989586621681190700"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681190700"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190702"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-596"></span><span>
</span><span id="line-597"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#simplExprGently"><span class="hs-identifier hs-type">simplExprGently</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Simplify.Env.html#SimplEnv"><span class="hs-identifier hs-type">SimplEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Simplify.Monad.html#SimplM"><span class="hs-identifier hs-type">SimplM</span></a></span><span> </span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span>
</span><span id="line-598"></span><span class="hs-comment">-- Simplifies an expression</span><span>
</span><span id="line-599"></span><span class="hs-comment">--      does occurrence analysis, then simplification</span><span>
</span><span id="line-600"></span><span class="hs-comment">--      and repeats (twice currently) because one pass</span><span>
</span><span id="line-601"></span><span class="hs-comment">--      alone leaves tons of crud.</span><span>
</span><span id="line-602"></span><span class="hs-comment">-- Used (a) for user expressions typed in at the interactive prompt</span><span>
</span><span id="line-603"></span><span class="hs-comment">--      (b) the LHS and RHS of a RULE</span><span>
</span><span id="line-604"></span><span class="hs-comment">--      (c) Template Haskell splices</span><span>
</span><span id="line-605"></span><span class="hs-comment">--</span><span>
</span><span id="line-606"></span><span class="hs-comment">-- The name 'Gently' suggests that the SimplMode is InitialPhase,</span><span>
</span><span id="line-607"></span><span class="hs-comment">-- and in fact that is so.... but the 'Gently' in simplExprGently doesn't</span><span>
</span><span id="line-608"></span><span class="hs-comment">-- enforce that; it just simplifies the expression twice</span><span>
</span><span id="line-609"></span><span>
</span><span id="line-610"></span><span class="hs-comment">-- It's important that simplExprGently does eta reduction; see</span><span>
</span><span id="line-611"></span><span class="hs-comment">-- Note [Simplifying the left-hand side of a RULE] above.  The</span><span>
</span><span id="line-612"></span><span class="hs-comment">-- simplifier does indeed do eta reduction (it's in GHC.Core.Opt.Simplify.completeLam)</span><span>
</span><span id="line-613"></span><span class="hs-comment">-- but only if -O is on.</span><span>
</span><span id="line-614"></span><span>
</span><span id="line-615"></span><span id="simplExprGently"><span class="annot"><span class="annottext">simplExprGently :: SimplEnv -&gt; CoreExpr -&gt; SimplM CoreExpr
</span><a href="GHC.Core.Opt.Pipeline.html#simplExprGently"><span class="hs-identifier hs-var hs-var">simplExprGently</span></a></span></span><span> </span><span id="local-6989586621681190678"><span class="annot"><span class="annottext">SimplEnv
</span><a href="#local-6989586621681190678"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span id="local-6989586621681190677"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190677"><span class="hs-identifier hs-var">expr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-616"></span><span>    </span><span id="local-6989586621681190676"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190676"><span class="hs-identifier hs-var">expr1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">SimplEnv -&gt; CoreExpr -&gt; SimplM CoreExpr
</span><a href="GHC.Core.Opt.Simplify.html#simplExpr"><span class="hs-identifier hs-var">simplExpr</span></a></span><span> </span><span class="annot"><span class="annottext">SimplEnv
</span><a href="#local-6989586621681190678"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Opt.OccurAnal.html#occurAnalyseExpr"><span class="hs-identifier hs-var">occurAnalyseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190677"><span class="hs-identifier hs-var">expr</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-617"></span><span>    </span><span class="annot"><span class="annottext">SimplEnv -&gt; CoreExpr -&gt; SimplM CoreExpr
</span><a href="GHC.Core.Opt.Simplify.html#simplExpr"><span class="hs-identifier hs-var">simplExpr</span></a></span><span> </span><span class="annot"><span class="annottext">SimplEnv
</span><a href="#local-6989586621681190678"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Opt.OccurAnal.html#occurAnalyseExpr"><span class="hs-identifier hs-var">occurAnalyseExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190676"><span class="hs-identifier hs-var">expr1</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-618"></span><span>
</span><span id="line-619"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
\subsection{The driver for the simplifier}
*                                                                      *
************************************************************************
-}</span><span>
</span><span id="line-626"></span><span>
</span><span id="line-627"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#simplifyPgm"><span class="hs-identifier hs-type">simplifyPgm</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreToDo"><span class="hs-identifier hs-type">CoreToDo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreM"><span class="hs-identifier hs-type">CoreM</span></a></span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span>
</span><span id="line-628"></span><span id="simplifyPgm"><span class="annot"><span class="annottext">simplifyPgm :: CoreToDo -&gt; ModGuts -&gt; CoreM ModGuts
</span><a href="GHC.Core.Opt.Pipeline.html#simplifyPgm"><span class="hs-identifier hs-var hs-var">simplifyPgm</span></a></span></span><span> </span><span id="local-6989586621681190675"><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190675"><span class="hs-identifier hs-var">pass</span></a></span></span><span> </span><span id="local-6989586621681190674"><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190674"><span class="hs-identifier hs-var">guts</span></a></span></span><span>
</span><span id="line-629"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681190673"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190673"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreM HscEnv
</span><a href="GHC.Core.Opt.Monad.html#getHscEnv"><span class="hs-identifier hs-var">getHscEnv</span></a></span><span>
</span><span id="line-630"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681190672"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190672"><span class="hs-identifier hs-var">us</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreM UniqSupply
forall (m :: * -&gt; *). MonadUnique m =&gt; m UniqSupply
</span><a href="GHC.Types.Unique.Supply.html#getUniqueSupplyM"><span class="hs-identifier hs-var">getUniqueSupplyM</span></a></span><span>
</span><span id="line-631"></span><span>       </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681190671"><span class="annot"><span class="annottext">RuleBase
</span><a href="#local-6989586621681190671"><span class="hs-identifier hs-var">rb</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CoreM RuleBase
</span><a href="GHC.Core.Opt.Monad.html#getRuleBase"><span class="hs-identifier hs-var">getRuleBase</span></a></span><span>
</span><span id="line-632"></span><span>       </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">IO (SimplCount, ModGuts) -&gt; CoreM ModGuts
forall a. IO (SimplCount, a) -&gt; CoreM a
</span><a href="GHC.Core.Opt.Monad.html#liftIOWithCount"><span class="hs-identifier hs-var">liftIOWithCount</span></a></span><span> </span><span class="annot"><span class="annottext">(IO (SimplCount, ModGuts) -&gt; CoreM ModGuts)
-&gt; IO (SimplCount, ModGuts) -&gt; CoreM ModGuts
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-633"></span><span>         </span><span class="annot"><span class="annottext">CoreToDo
-&gt; HscEnv
-&gt; UniqSupply
-&gt; RuleBase
-&gt; ModGuts
-&gt; IO (SimplCount, ModGuts)
</span><a href="GHC.Core.Opt.Pipeline.html#simplifyPgmIO"><span class="hs-identifier hs-var">simplifyPgmIO</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190675"><span class="hs-identifier hs-var">pass</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190673"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190672"><span class="hs-identifier hs-var">us</span></a></span><span> </span><span class="annot"><span class="annottext">RuleBase
</span><a href="#local-6989586621681190671"><span class="hs-identifier hs-var">rb</span></a></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190674"><span class="hs-identifier hs-var">guts</span></a></span><span> </span><span class="hs-special">}</span><span>
</span><span id="line-634"></span><span>
</span><span id="line-635"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#simplifyPgmIO"><span class="hs-identifier hs-type">simplifyPgmIO</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreToDo"><span class="hs-identifier hs-type">CoreToDo</span></a></span><span>
</span><span id="line-636"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#HscEnv"><span class="hs-identifier hs-type">HscEnv</span></a></span><span>
</span><span id="line-637"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSupply"><span class="hs-identifier hs-type">UniqSupply</span></a></span><span>
</span><span id="line-638"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#RuleBase"><span class="hs-identifier hs-type">RuleBase</span></a></span><span>
</span><span id="line-639"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span>
</span><span id="line-640"></span><span>              </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.Monad.html#SimplCount"><span class="hs-identifier hs-type">SimplCount</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- New bindings</span><span>
</span><span id="line-641"></span><span>
</span><span id="line-642"></span><span id="simplifyPgmIO"><span class="annot"><span class="annottext">simplifyPgmIO :: CoreToDo
-&gt; HscEnv
-&gt; UniqSupply
-&gt; RuleBase
-&gt; ModGuts
-&gt; IO (SimplCount, ModGuts)
</span><a href="GHC.Core.Opt.Pipeline.html#simplifyPgmIO"><span class="hs-identifier hs-var hs-var">simplifyPgmIO</span></a></span></span><span> </span><span id="local-6989586621681190668"><span class="annot"><span class="annottext">pass :: CoreToDo
</span><a href="#local-6989586621681190668"><span class="hs-identifier hs-var">pass</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.Opt.Monad.html#CoreDoSimplify"><span class="hs-identifier hs-type">CoreDoSimplify</span></a></span><span> </span><span id="local-6989586621681190667"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190667"><span class="hs-identifier hs-var">max_iterations</span></a></span></span><span> </span><span id="local-6989586621681190666"><span class="annot"><span class="annottext">SimplMode
</span><a href="#local-6989586621681190666"><span class="hs-identifier hs-var">mode</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-643"></span><span>              </span><span id="local-6989586621681190665"><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190665"><span class="hs-identifier hs-var">hsc_env</span></a></span></span><span> </span><span id="local-6989586621681190664"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190664"><span class="hs-identifier hs-var">us</span></a></span></span><span> </span><span id="local-6989586621681190663"><span class="annot"><span class="annottext">RuleBase
</span><a href="#local-6989586621681190663"><span class="hs-identifier hs-var">hpt_rule_base</span></a></span></span><span>
</span><span id="line-644"></span><span>              </span><span id="local-6989586621681190662"><span class="annot"><span class="annottext">guts :: ModGuts
</span><a href="#local-6989586621681190662"><span class="hs-identifier hs-var">guts</span></a></span></span><span class="hs-glyph">@</span><span class="hs-special">(</span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_module :: ModGuts -&gt; Module
</span><a href="GHC.Driver.Types.html#mg_module"><span class="hs-identifier hs-var">mg_module</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681190661"><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681190661"><span class="hs-identifier hs-var">this_mod</span></a></span></span><span>
</span><span id="line-645"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_rdr_env :: ModGuts -&gt; GlobalRdrEnv
</span><a href="GHC.Driver.Types.html#mg_rdr_env"><span class="hs-identifier hs-var">mg_rdr_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681190660"><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681190660"><span class="hs-identifier hs-var">rdr_env</span></a></span></span><span>
</span><span id="line-646"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_deps :: ModGuts -&gt; Dependencies
</span><a href="GHC.Driver.Types.html#mg_deps"><span class="hs-identifier hs-var">mg_deps</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681190659"><span class="annot"><span class="annottext">Dependencies
</span><a href="#local-6989586621681190659"><span class="hs-identifier hs-var">deps</span></a></span></span><span>
</span><span id="line-647"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_binds :: ModGuts -&gt; CoreProgram
</span><a href="GHC.Driver.Types.html#mg_binds"><span class="hs-identifier hs-var">mg_binds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681190658"><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190658"><span class="hs-identifier hs-var">binds</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_rules :: ModGuts -&gt; [CoreRule]
</span><a href="GHC.Driver.Types.html#mg_rules"><span class="hs-identifier hs-var">mg_rules</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681190657"><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681190657"><span class="hs-identifier hs-var">rules</span></a></span></span><span>
</span><span id="line-648"></span><span>                            </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_fam_inst_env :: ModGuts -&gt; PackageFamInstEnv
</span><a href="GHC.Driver.Types.html#mg_fam_inst_env"><span class="hs-identifier hs-var">mg_fam_inst_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span id="local-6989586621681190656"><span class="annot"><span class="annottext">PackageFamInstEnv
</span><a href="#local-6989586621681190656"><span class="hs-identifier hs-var">fam_inst_env</span></a></span></span><span> </span><span class="hs-special">}</span><span class="hs-special">)</span><span>
</span><span id="line-649"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681190655"><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681190655"><span class="hs-identifier hs-var">termination_msg</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681190654"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190654"><span class="hs-identifier hs-var">it_count</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681190653"><span class="annot"><span class="annottext">SimplCount
</span><a href="#local-6989586621681190653"><span class="hs-identifier hs-var">counts_out</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681190652"><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190652"><span class="hs-identifier hs-var">guts'</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-650"></span><span>           </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">UniqSupply
-&gt; Int
-&gt; [SimplCount]
-&gt; CoreProgram
-&gt; [CoreRule]
-&gt; IO (String, Int, SimplCount, ModGuts)
</span><a href="#local-6989586621681190651"><span class="hs-identifier hs-var">do_iteration</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190664"><span class="hs-identifier hs-var">us</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190658"><span class="hs-identifier hs-var">binds</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681190657"><span class="hs-identifier hs-var">rules</span></a></span><span>
</span><span id="line-651"></span><span>
</span><span id="line-652"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Bool -&gt; String -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet"><span class="hs-identifier hs-var">Err.dumpIfSet</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190650"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DumpFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#dopt"><span class="hs-identifier hs-var">dopt</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_verbose_core2core"><span class="hs-identifier hs-var">Opt_D_verbose_core2core</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190650"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span>
</span><span id="line-653"></span><span>                                </span><span class="annot"><span class="annottext">DumpFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#dopt"><span class="hs-identifier hs-var">dopt</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_simpl_stats"><span class="hs-identifier hs-var">Opt_D_dump_simpl_stats</span></a></span><span>  </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190650"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-654"></span><span>                  </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Simplifier statistics for following pass&quot;</span></span><span>
</span><span id="line-655"></span><span>                  </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><a href="#local-6989586621681190655"><span class="hs-identifier hs-var">termination_msg</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;after&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190654"><span class="hs-identifier hs-var">it_count</span></a></span><span>
</span><span id="line-656"></span><span>                                              </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;iterations&quot;</span></span><span class="hs-special">,</span><span>
</span><span id="line-657"></span><span>                         </span><span class="annot"><span class="annottext">SDoc
</span><a href="GHC.Utils.Outputable.html#blankLine"><span class="hs-identifier hs-var">blankLine</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-658"></span><span>                         </span><span class="annot"><span class="annottext">SimplCount -&gt; SDoc
</span><a href="GHC.Core.Opt.Monad.html#pprSimplCount"><span class="hs-identifier hs-var">pprSimplCount</span></a></span><span> </span><span class="annot"><span class="annottext">SimplCount
</span><a href="#local-6989586621681190653"><span class="hs-identifier hs-var">counts_out</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-659"></span><span>
</span><span id="line-660"></span><span>        </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(SimplCount, ModGuts) -&gt; IO (SimplCount, ModGuts)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SimplCount
</span><a href="#local-6989586621681190653"><span class="hs-identifier hs-var">counts_out</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190652"><span class="hs-identifier hs-var">guts'</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-661"></span><span>    </span><span class="hs-special">}</span><span>
</span><span id="line-662"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-663"></span><span>    </span><span id="local-6989586621681190650"><span class="annot"><span class="annottext">dflags :: DynFlags
</span><a href="#local-6989586621681190650"><span class="hs-identifier hs-var hs-var">dflags</span></a></span></span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; DynFlags
</span><a href="GHC.Driver.Types.html#hsc_dflags"><span class="hs-identifier hs-var hs-var">hsc_dflags</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190665"><span class="hs-identifier hs-var">hsc_env</span></a></span><span>
</span><span id="line-664"></span><span>    </span><span id="local-6989586621681190646"><span class="annot"><span class="annottext">print_unqual :: PrintUnqualified
</span><a href="#local-6989586621681190646"><span class="hs-identifier hs-var hs-var">print_unqual</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; GlobalRdrEnv -&gt; PrintUnqualified
</span><a href="GHC.Driver.Types.html#mkPrintUnqualified"><span class="hs-identifier hs-var">mkPrintUnqualified</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190650"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">GlobalRdrEnv
</span><a href="#local-6989586621681190660"><span class="hs-identifier hs-var">rdr_env</span></a></span><span>
</span><span id="line-665"></span><span>    </span><span id="local-6989586621681190645"><span class="annot"><span class="annottext">simpl_env :: SimplEnv
</span><a href="#local-6989586621681190645"><span class="hs-identifier hs-var hs-var">simpl_env</span></a></span></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SimplMode -&gt; SimplEnv
</span><a href="GHC.Core.Opt.Simplify.Env.html#mkSimplEnv"><span class="hs-identifier hs-var">mkSimplEnv</span></a></span><span> </span><span class="annot"><span class="annottext">SimplMode
</span><a href="#local-6989586621681190666"><span class="hs-identifier hs-var">mode</span></a></span><span>
</span><span id="line-666"></span><span>    </span><span id="local-6989586621681190643"><span class="annot"><span class="annottext">active_rule :: Activation -&gt; Bool
</span><a href="#local-6989586621681190643"><span class="hs-identifier hs-var hs-var">active_rule</span></a></span></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SimplMode -&gt; Activation -&gt; Bool
</span><a href="GHC.Core.Opt.Simplify.Utils.html#activeRule"><span class="hs-identifier hs-var">activeRule</span></a></span><span> </span><span class="annot"><span class="annottext">SimplMode
</span><a href="#local-6989586621681190666"><span class="hs-identifier hs-var">mode</span></a></span><span>
</span><span id="line-667"></span><span>    </span><span id="local-6989586621681190642"><span class="annot"><span class="annottext">active_unf :: Id -&gt; Bool
</span><a href="#local-6989586621681190642"><span class="hs-identifier hs-var hs-var">active_unf</span></a></span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">SimplMode -&gt; Id -&gt; Bool
</span><a href="GHC.Core.Opt.Simplify.Utils.html#activeUnfolding"><span class="hs-identifier hs-var">activeUnfolding</span></a></span><span> </span><span class="annot"><span class="annottext">SimplMode
</span><a href="#local-6989586621681190666"><span class="hs-identifier hs-var">mode</span></a></span><span>
</span><span id="line-668"></span><span>
</span><span id="line-669"></span><span>    </span><span class="annot"><a href="#local-6989586621681190651"><span class="hs-identifier hs-type">do_iteration</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Unique.Supply.html#UniqSupply"><span class="hs-identifier hs-type">UniqSupply</span></a></span><span>
</span><span id="line-670"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>          </span><span class="hs-comment">-- Counts iterations</span><span>
</span><span id="line-671"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Opt.Monad.html#SimplCount"><span class="hs-identifier hs-type">SimplCount</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- Counts from earlier iterations, reversed</span><span>
</span><span id="line-672"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span>  </span><span class="hs-comment">-- Bindings in</span><span>
</span><span id="line-673"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreRule"><span class="hs-identifier hs-type">CoreRule</span></a></span><span class="hs-special">]</span><span>   </span><span class="hs-comment">-- and orphan rules</span><span>
</span><span id="line-674"></span><span>                 </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#String"><span class="hs-identifier hs-type">String</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#SimplCount"><span class="hs-identifier hs-type">SimplCount</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Driver.Types.html#ModGuts"><span class="hs-identifier hs-type">ModGuts</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-675"></span><span>
</span><span id="line-676"></span><span>    </span><span id="local-6989586621681190651"><span class="annot"><span class="annottext">do_iteration :: UniqSupply
-&gt; Int
-&gt; [SimplCount]
-&gt; CoreProgram
-&gt; [CoreRule]
-&gt; IO (String, Int, SimplCount, ModGuts)
</span><a href="#local-6989586621681190651"><span class="hs-identifier hs-var hs-var">do_iteration</span></a></span></span><span> </span><span id="local-6989586621681190641"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190641"><span class="hs-identifier hs-var">us</span></a></span></span><span> </span><span id="local-6989586621681190640"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190640"><span class="hs-identifier hs-var">iteration_no</span></a></span></span><span> </span><span id="local-6989586621681190639"><span class="annot"><span class="annottext">[SimplCount]
</span><a href="#local-6989586621681190639"><span class="hs-identifier hs-var">counts_so_far</span></a></span></span><span> </span><span id="local-6989586621681190638"><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190638"><span class="hs-identifier hs-var">binds</span></a></span></span><span> </span><span id="local-6989586621681190637"><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681190637"><span class="hs-identifier hs-var">rules</span></a></span></span><span>
</span><span id="line-677"></span><span>        </span><span class="hs-comment">-- iteration_no is the number of the iteration we are</span><span>
</span><span id="line-678"></span><span>        </span><span class="hs-comment">-- about to begin, with '1' for the first</span><span>
</span><span id="line-679"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190640"><span class="hs-identifier hs-var">iteration_no</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Ord a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">&gt;</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190667"><span class="hs-identifier hs-var">max_iterations</span></a></span><span>   </span><span class="hs-comment">-- Stop if we've run out of iterations</span><span>
</span><span id="line-680"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">WARN</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">debugIsOn</span><span> </span><span class="hs-operator">&amp;&amp;</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">max_iterations</span><span> </span><span class="hs-operator">&gt;</span><span> </span><span class="hs-number">2</span><span class="hs-special">)</span><span>
</span><span id="line-681"></span><span>            </span><span class="hs-special">,</span><span> </span><span class="hs-identifier">hang</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">text</span><span> </span><span class="hs-string">&quot;Simplifier bailing out after&quot;</span><span> </span><span class="hs-operator">&lt;+&gt;</span><span> </span><span class="hs-identifier">int</span><span> </span><span class="hs-identifier">max_iterations</span><span>
</span><span id="line-682"></span><span>                    </span><span class="hs-operator">&lt;+&gt;</span><span> </span><span class="hs-identifier">text</span><span> </span><span class="hs-string">&quot;iterations&quot;</span><span>
</span><span id="line-683"></span><span>                    </span><span class="hs-operator">&lt;+&gt;</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">brackets</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">hsep</span><span> </span><span class="hs-operator">$</span><span> </span><span class="hs-identifier">punctuate</span><span> </span><span class="hs-identifier">comma</span><span> </span><span class="hs-operator">$</span><span>
</span><span id="line-684"></span><span>                         </span><span class="hs-identifier">map</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">int</span><span> </span><span class="hs-operator">.</span><span> </span><span class="hs-identifier">simplCountN</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">reverse</span><span> </span><span class="hs-identifier">counts_so_far</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-685"></span><span>                 </span><span class="hs-number">2</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">text</span><span> </span><span class="hs-string">&quot;Size =&quot;</span><span> </span><span class="hs-operator">&lt;+&gt;</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-special">(</span><span class="hs-identifier">coreBindsStats</span><span> </span><span class="hs-identifier">binds</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-686"></span><span>
</span><span id="line-687"></span><span>                </span><span class="hs-comment">-- Subtract 1 from iteration_no to get the</span><span>
</span><span id="line-688"></span><span>                </span><span class="hs-comment">-- number of iterations we actually completed</span><span>
</span><span id="line-689"></span><span>        </span><span class="annot"><span class="annottext">(String, Int, SimplCount, ModGuts)
-&gt; IO (String, Int, SimplCount, ModGuts)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Simplifier baled out&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190640"><span class="hs-identifier hs-var">iteration_no</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-690"></span><span>               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[SimplCount] -&gt; SimplCount
</span><a href="#local-6989586621681190626"><span class="hs-identifier hs-var">totalise</span></a></span><span> </span><span class="annot"><span class="annottext">[SimplCount]
</span><a href="#local-6989586621681190639"><span class="hs-identifier hs-var">counts_so_far</span></a></span><span>
</span><span id="line-691"></span><span>               </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190662"><span class="hs-identifier hs-var">guts</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_binds :: CoreProgram
</span><a href="GHC.Driver.Types.html#mg_binds"><span class="hs-identifier hs-var">mg_binds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190638"><span class="hs-identifier hs-var">binds</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_rules :: [CoreRule]
</span><a href="GHC.Driver.Types.html#mg_rules"><span class="hs-identifier hs-var">mg_rules</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681190637"><span class="hs-identifier hs-var">rules</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-692"></span><span>
</span><span id="line-693"></span><span>      </span><span class="hs-comment">-- Try and force thunks off the binds; significantly reduces</span><span>
</span><span id="line-694"></span><span>      </span><span class="hs-comment">-- space usage, especially with -O.  JRS, 000620.</span><span>
</span><span id="line-695"></span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681190625"><span class="annot"><span class="annottext">sz :: Int
</span><a href="#local-6989586621681190625"><span class="hs-identifier hs-var hs-var">sz</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreProgram -&gt; Int
</span><a href="GHC.Core.Stats.html#coreBindsSize"><span class="hs-identifier hs-var">coreBindsSize</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190638"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-696"></span><span>      </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190625"><span class="hs-identifier hs-var">sz</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; () -&gt; ()
</span><span class="hs-operator hs-var">`seq`</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>     </span><span class="hs-comment">-- Force it</span><span>
</span><span id="line-697"></span><span>      </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-698"></span><span>                </span><span class="hs-comment">-- Occurrence analysis</span><span>
</span><span id="line-699"></span><span>           </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681190624"><span class="annot"><span class="annottext">tagged_binds :: CoreProgram
</span><a href="#local-6989586621681190624"><span class="hs-identifier hs-var hs-var">tagged_binds</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;OccAnal&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-700"></span><span>                     </span><span class="annot"><span class="annottext">Module
-&gt; (Id -&gt; Bool)
-&gt; (Activation -&gt; Bool)
-&gt; [CoreRule]
-&gt; CoreProgram
-&gt; CoreProgram
</span><a href="GHC.Core.Opt.OccurAnal.html#occurAnalysePgm"><span class="hs-identifier hs-var">occurAnalysePgm</span></a></span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681190661"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="#local-6989586621681190642"><span class="hs-identifier hs-var">active_unf</span></a></span><span> </span><span class="annot"><span class="annottext">Activation -&gt; Bool
</span><a href="#local-6989586621681190643"><span class="hs-identifier hs-var">active_rule</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681190637"><span class="hs-identifier hs-var">rules</span></a></span><span>
</span><span id="line-701"></span><span>                                     </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190638"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-702"></span><span>               </span><span class="hs-special">}</span><span> </span><span class="hs-special">;</span><span>
</span><span id="line-703"></span><span>           </span><span class="annot"><span class="annottext">DynFlags -&gt; DumpFlag -&gt; String -&gt; DumpFormat -&gt; SDoc -&gt; IO ()
</span><a href="GHC.Utils.Error.html#dumpIfSet_dyn"><span class="hs-identifier hs-var">Err.dumpIfSet_dyn</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190650"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_occur_anal"><span class="hs-identifier hs-var">Opt_D_dump_occur_anal</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Occurrence analysis&quot;</span></span><span>
</span><span id="line-704"></span><span>                     </span><span class="annot"><span class="annottext">DumpFormat
</span><a href="GHC.Utils.Error.html#FormatCore"><span class="hs-identifier hs-var">FormatCore</span></a></span><span>
</span><span id="line-705"></span><span>                     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreProgram -&gt; SDoc
forall b. OutputableBndr b =&gt; [Bind b] -&gt; SDoc
</span><a href="GHC.Core.Ppr.html#pprCoreBindings"><span class="hs-identifier hs-var">pprCoreBindings</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190624"><span class="hs-identifier hs-var">tagged_binds</span></a></span><span class="hs-special">)</span><span class="hs-special">;</span><span>
</span><span id="line-706"></span><span>
</span><span id="line-707"></span><span>                </span><span class="hs-comment">-- Get any new rules, and extend the rule base</span><span>
</span><span id="line-708"></span><span>                </span><span class="hs-comment">-- See Note [Overall plumbing for rules] in GHC.Core.Rules</span><span>
</span><span id="line-709"></span><span>                </span><span class="hs-comment">-- We need to do this regularly, because simplification can</span><span>
</span><span id="line-710"></span><span>                </span><span class="hs-comment">-- poke on IdInfo thunks, which in turn brings in new rules</span><span>
</span><span id="line-711"></span><span>                </span><span class="hs-comment">-- behind the scenes.  Otherwise there's a danger we'll simply</span><span>
</span><span id="line-712"></span><span>                </span><span class="hs-comment">-- miss the rules for Ids hidden inside imported inlinings</span><span>
</span><span id="line-713"></span><span>           </span><span id="local-6989586621681190622"><span class="annot"><span class="annottext">ExternalPackageState
</span><a href="#local-6989586621681190622"><span class="hs-identifier hs-var">eps</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">HscEnv -&gt; IO ExternalPackageState
</span><a href="GHC.Driver.Types.html#hscEPS"><span class="hs-identifier hs-var">hscEPS</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190665"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="hs-special">;</span><span>
</span><span id="line-714"></span><span>           </span><span class="hs-keyword">let</span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681190621"><span class="annot"><span class="annottext">rule_base1 :: RuleBase
</span><a href="#local-6989586621681190621"><span class="hs-identifier hs-var hs-var">rule_base1</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RuleBase -&gt; RuleBase -&gt; RuleBase
</span><a href="GHC.Core.Rules.html#unionRuleBase"><span class="hs-identifier hs-var">unionRuleBase</span></a></span><span> </span><span class="annot"><span class="annottext">RuleBase
</span><a href="#local-6989586621681190663"><span class="hs-identifier hs-var">hpt_rule_base</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExternalPackageState -&gt; RuleBase
</span><a href="GHC.Driver.Types.html#eps_rule_base"><span class="hs-identifier hs-var hs-var">eps_rule_base</span></a></span><span> </span><span class="annot"><span class="annottext">ExternalPackageState
</span><a href="#local-6989586621681190622"><span class="hs-identifier hs-var">eps</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-715"></span><span>                </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681190620"><span class="annot"><span class="annottext">rule_base2 :: RuleBase
</span><a href="#local-6989586621681190620"><span class="hs-identifier hs-var hs-var">rule_base2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">RuleBase -&gt; [CoreRule] -&gt; RuleBase
</span><a href="GHC.Core.Rules.html#extendRuleBaseList"><span class="hs-identifier hs-var">extendRuleBaseList</span></a></span><span> </span><span class="annot"><span class="annottext">RuleBase
</span><a href="#local-6989586621681190621"><span class="hs-identifier hs-var">rule_base1</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681190637"><span class="hs-identifier hs-var">rules</span></a></span><span>
</span><span id="line-716"></span><span>                </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681190619"><span class="annot"><span class="annottext">fam_envs :: FamInstEnvs
</span><a href="#local-6989586621681190619"><span class="hs-identifier hs-var hs-var">fam_envs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">ExternalPackageState -&gt; PackageFamInstEnv
</span><a href="GHC.Driver.Types.html#eps_fam_inst_env"><span class="hs-identifier hs-var hs-var">eps_fam_inst_env</span></a></span><span> </span><span class="annot"><span class="annottext">ExternalPackageState
</span><a href="#local-6989586621681190622"><span class="hs-identifier hs-var">eps</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">PackageFamInstEnv
</span><a href="#local-6989586621681190656"><span class="hs-identifier hs-var">fam_inst_env</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-717"></span><span>                </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681190618"><span class="annot"><span class="annottext">vis_orphs :: [Module]
</span><a href="#local-6989586621681190618"><span class="hs-identifier hs-var hs-var">vis_orphs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Module
</span><a href="#local-6989586621681190661"><span class="hs-identifier hs-var">this_mod</span></a></span><span> </span><span class="annot"><span class="annottext">Module -&gt; [Module] -&gt; [Module]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">Dependencies -&gt; [Module]
</span><a href="GHC.Driver.Types.html#dep_orphs"><span class="hs-identifier hs-var hs-var">dep_orphs</span></a></span><span> </span><span class="annot"><span class="annottext">Dependencies
</span><a href="#local-6989586621681190659"><span class="hs-identifier hs-var">deps</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">;</span><span>
</span><span id="line-718"></span><span>
</span><span id="line-719"></span><span>                </span><span class="hs-comment">-- Simplify the program</span><span>
</span><span id="line-720"></span><span>           </span><span class="hs-special">(</span><span class="hs-special">(</span><span id="local-6989586621681190617"><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190617"><span class="hs-identifier hs-var">binds1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681190616"><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681190616"><span class="hs-identifier hs-var">rules1</span></a></span></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span id="local-6989586621681190615"><span class="annot"><span class="annottext">SimplCount
</span><a href="#local-6989586621681190615"><span class="hs-identifier hs-var">counts1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span>
</span><span id="line-721"></span><span>             </span><span class="annot"><span class="annottext">DynFlags
-&gt; RuleEnv
-&gt; FamInstEnvs
-&gt; UniqSupply
-&gt; Int
-&gt; SimplM (CoreProgram, [CoreRule])
-&gt; IO ((CoreProgram, [CoreRule]), SimplCount)
forall a.
DynFlags
-&gt; RuleEnv
-&gt; FamInstEnvs
-&gt; UniqSupply
-&gt; Int
-&gt; SimplM a
-&gt; IO (a, SimplCount)
</span><a href="GHC.Core.Opt.Simplify.Monad.html#initSmpl"><span class="hs-identifier hs-var">initSmpl</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190650"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">RuleBase -&gt; [Module] -&gt; RuleEnv
</span><a href="GHC.Core.html#mkRuleEnv"><span class="hs-identifier hs-var">mkRuleEnv</span></a></span><span> </span><span class="annot"><span class="annottext">RuleBase
</span><a href="#local-6989586621681190620"><span class="hs-identifier hs-var">rule_base2</span></a></span><span> </span><span class="annot"><span class="annottext">[Module]
</span><a href="#local-6989586621681190618"><span class="hs-identifier hs-var">vis_orphs</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">FamInstEnvs
</span><a href="#local-6989586621681190619"><span class="hs-identifier hs-var">fam_envs</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190614"><span class="hs-identifier hs-var">us1</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190625"><span class="hs-identifier hs-var">sz</span></a></span><span> </span><span class="annot"><span class="annottext">(SimplM (CoreProgram, [CoreRule])
 -&gt; IO ((CoreProgram, [CoreRule]), SimplCount))
-&gt; SimplM (CoreProgram, [CoreRule])
-&gt; IO ((CoreProgram, [CoreRule]), SimplCount)
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-722"></span><span>               </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681190613"><span class="annot"><span class="annottext">SimplFloats
</span><a href="#local-6989586621681190613"><span class="hs-identifier hs-var">floats</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681190612"><span class="annot"><span class="annottext">SimplEnv
</span><a href="#local-6989586621681190612"><span class="hs-identifier hs-var">env1</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;SimplTopBinds&quot;</span><span> </span><span class="hs-pragma">#-}</span><span>
</span><span id="line-723"></span><span>                                      </span><span class="annot"><span class="annottext">SimplEnv -&gt; CoreProgram -&gt; SimplM (SimplFloats, SimplEnv)
</span><a href="GHC.Core.Opt.Simplify.html#simplTopBinds"><span class="hs-identifier hs-var">simplTopBinds</span></a></span><span> </span><span class="annot"><span class="annottext">SimplEnv
</span><a href="#local-6989586621681190645"><span class="hs-identifier hs-var">simpl_env</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190624"><span class="hs-identifier hs-var">tagged_binds</span></a></span><span>
</span><span id="line-724"></span><span>
</span><span id="line-725"></span><span>                      </span><span class="hs-comment">-- Apply the substitution to rules defined in this module</span><span>
</span><span id="line-726"></span><span>                      </span><span class="hs-comment">-- for imported Ids.  Eg  RULE map my_f = blah</span><span>
</span><span id="line-727"></span><span>                      </span><span class="hs-comment">-- If we have a substitution my_f :-&gt; other_f, we'd better</span><span>
</span><span id="line-728"></span><span>                      </span><span class="hs-comment">-- apply it to the rule to, or it'll never match</span><span>
</span><span id="line-729"></span><span>                  </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681190611"><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681190611"><span class="hs-identifier hs-var">rules1</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">SimplEnv
-&gt; Maybe Id -&gt; [CoreRule] -&gt; MaybeJoinCont -&gt; SimplM [CoreRule]
</span><a href="GHC.Core.Opt.Simplify.html#simplRules"><span class="hs-identifier hs-var">simplRules</span></a></span><span> </span><span class="annot"><span class="annottext">SimplEnv
</span><a href="#local-6989586621681190612"><span class="hs-identifier hs-var">env1</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe Id
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681190637"><span class="hs-identifier hs-var">rules</span></a></span><span> </span><span class="annot"><span class="annottext">MaybeJoinCont
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-730"></span><span>
</span><span id="line-731"></span><span>                  </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">(CoreProgram, [CoreRule]) -&gt; SimplM (CoreProgram, [CoreRule])
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SimplFloats -&gt; CoreProgram
</span><a href="GHC.Core.Opt.Simplify.Env.html#getTopFloatBinds"><span class="hs-identifier hs-var">getTopFloatBinds</span></a></span><span> </span><span class="annot"><span class="annottext">SimplFloats
</span><a href="#local-6989586621681190613"><span class="hs-identifier hs-var">floats</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681190611"><span class="hs-identifier hs-var">rules1</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">;</span><span>
</span><span id="line-732"></span><span>
</span><span id="line-733"></span><span>                </span><span class="hs-comment">-- Stop if nothing happened; don't dump output</span><span>
</span><span id="line-734"></span><span>                </span><span class="hs-comment">-- See Note [Which transformations are innocuous] in GHC.Core.Opt.Monad</span><span>
</span><span id="line-735"></span><span>           </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">SimplCount -&gt; Bool
</span><a href="GHC.Core.Opt.Monad.html#isZeroSimplCount"><span class="hs-identifier hs-var">isZeroSimplCount</span></a></span><span> </span><span class="annot"><span class="annottext">SimplCount
</span><a href="#local-6989586621681190615"><span class="hs-identifier hs-var">counts1</span></a></span><span> </span><span class="hs-keyword">then</span><span>
</span><span id="line-736"></span><span>                </span><span class="annot"><span class="annottext">(String, Int, SimplCount, ModGuts)
-&gt; IO (String, Int, SimplCount, ModGuts)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Simplifier reached fixed point&quot;</span></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190640"><span class="hs-identifier hs-var">iteration_no</span></a></span><span>
</span><span id="line-737"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[SimplCount] -&gt; SimplCount
</span><a href="#local-6989586621681190626"><span class="hs-identifier hs-var">totalise</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SimplCount
</span><a href="#local-6989586621681190615"><span class="hs-identifier hs-var">counts1</span></a></span><span> </span><span class="annot"><span class="annottext">SimplCount -&gt; [SimplCount] -&gt; [SimplCount]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span> </span><span class="annot"><span class="annottext">[SimplCount]
</span><a href="#local-6989586621681190639"><span class="hs-identifier hs-var">counts_so_far</span></a></span><span class="hs-special">)</span><span>  </span><span class="hs-comment">-- Include &quot;free&quot; ticks</span><span>
</span><span id="line-738"></span><span>                       </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><a href="#local-6989586621681190662"><span class="hs-identifier hs-var">guts</span></a></span><span> </span><span class="hs-special">{</span><span> </span><span class="annot"><span class="annottext">mg_binds :: CoreProgram
</span><a href="GHC.Driver.Types.html#mg_binds"><span class="hs-identifier hs-var">mg_binds</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190617"><span class="hs-identifier hs-var">binds1</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">mg_rules :: [CoreRule]
</span><a href="GHC.Driver.Types.html#mg_rules"><span class="hs-identifier hs-var">mg_rules</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681190616"><span class="hs-identifier hs-var">rules1</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-739"></span><span>           </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span> </span><span class="hs-special">{</span><span>
</span><span id="line-740"></span><span>                </span><span class="hs-comment">-- Short out indirections</span><span>
</span><span id="line-741"></span><span>                </span><span class="hs-comment">-- We do this *after* at least one run of the simplifier</span><span>
</span><span id="line-742"></span><span>                </span><span class="hs-comment">-- because indirection-shorting uses the export flag on *occurrences*</span><span>
</span><span id="line-743"></span><span>                </span><span class="hs-comment">-- and that isn't guaranteed to be ok until after the first run propagates</span><span>
</span><span id="line-744"></span><span>                </span><span class="hs-comment">-- stuff from the binding site to its occurrences</span><span>
</span><span id="line-745"></span><span>                </span><span class="hs-comment">--</span><span>
</span><span id="line-746"></span><span>                </span><span class="hs-comment">-- ToDo: alas, this means that indirection-shorting does not happen at all</span><span>
</span><span id="line-747"></span><span>                </span><span class="hs-comment">--       if the simplifier does nothing (not common, I know, but unsavoury)</span><span>
</span><span id="line-748"></span><span>           </span><span class="hs-keyword">let</span><span> </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681190608"><span class="annot"><span class="annottext">binds2 :: CoreProgram
</span><a href="#local-6989586621681190608"><span class="hs-identifier hs-var hs-var">binds2</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-pragma">{-# SCC</span><span> </span><span class="hs-pragma">&quot;ZapInd&quot;</span><span> </span><span class="hs-pragma">#-}</span><span> </span><span class="annot"><span class="annottext">CoreProgram -&gt; CoreProgram
</span><a href="GHC.Core.Opt.Pipeline.html#shortOutIndirections"><span class="hs-identifier hs-var">shortOutIndirections</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190617"><span class="hs-identifier hs-var">binds1</span></a></span><span> </span><span class="hs-special">}</span><span> </span><span class="hs-special">;</span><span>
</span><span id="line-749"></span><span>
</span><span id="line-750"></span><span>                </span><span class="hs-comment">-- Dump the result of this iteration</span><span>
</span><span id="line-751"></span><span>           </span><span class="annot"><span class="annottext">DynFlags
-&gt; PrintUnqualified
-&gt; Int
-&gt; SimplCount
-&gt; CoreProgram
-&gt; [CoreRule]
-&gt; IO ()
</span><a href="GHC.Core.Opt.Pipeline.html#dump_end_iteration"><span class="hs-identifier hs-var">dump_end_iteration</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190650"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621681190646"><span class="hs-identifier hs-var">print_unqual</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190640"><span class="hs-identifier hs-var">iteration_no</span></a></span><span> </span><span class="annot"><span class="annottext">SimplCount
</span><a href="#local-6989586621681190615"><span class="hs-identifier hs-var">counts1</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190608"><span class="hs-identifier hs-var">binds2</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681190616"><span class="hs-identifier hs-var">rules1</span></a></span><span> </span><span class="hs-special">;</span><span>
</span><span id="line-752"></span><span>           </span><span class="annot"><span class="annottext">HscEnv -&gt; CoreToDo -&gt; CoreProgram -&gt; IO ()
</span><a href="GHC.Core.Lint.html#lintPassResult"><span class="hs-identifier hs-var">lintPassResult</span></a></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><a href="#local-6989586621681190665"><span class="hs-identifier hs-var">hsc_env</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><a href="#local-6989586621681190668"><span class="hs-identifier hs-var">pass</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190608"><span class="hs-identifier hs-var">binds2</span></a></span><span> </span><span class="hs-special">;</span><span>
</span><span id="line-753"></span><span>
</span><span id="line-754"></span><span>                </span><span class="hs-comment">-- Loop</span><span>
</span><span id="line-755"></span><span>           </span><span class="annot"><span class="annottext">UniqSupply
-&gt; Int
-&gt; [SimplCount]
-&gt; CoreProgram
-&gt; [CoreRule]
-&gt; IO (String, Int, SimplCount, ModGuts)
</span><a href="#local-6989586621681190651"><span class="hs-identifier hs-var">do_iteration</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190605"><span class="hs-identifier hs-var">us2</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190640"><span class="hs-identifier hs-var">iteration_no</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">SimplCount
</span><a href="#local-6989586621681190615"><span class="hs-identifier hs-var">counts1</span></a></span><span class="annot"><span class="annottext">SimplCount -&gt; [SimplCount] -&gt; [SimplCount]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span class="annot"><span class="annottext">[SimplCount]
</span><a href="#local-6989586621681190639"><span class="hs-identifier hs-var">counts_so_far</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190608"><span class="hs-identifier hs-var">binds2</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681190616"><span class="hs-identifier hs-var">rules1</span></a></span><span>
</span><span id="line-756"></span><span>           </span><span class="hs-special">}</span><span> </span><span class="hs-special">}</span><span class="hs-cpp">
#if __GLASGOW_HASKELL__ &lt;= 810
</span><span>      </span><span class="hs-glyph">|</span><span> </span><span class="hs-identifier">otherwise</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-identifier">panic</span><span> </span><span class="hs-string">&quot;do_iteration&quot;</span><span class="hs-cpp">
#endif
</span><span>      </span><span class="hs-keyword">where</span><span>
</span><span id="line-761"></span><span>        </span><span class="hs-special">(</span><span id="local-6989586621681190614"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190614"><span class="hs-identifier hs-var">us1</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681190605"><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190605"><span class="hs-identifier hs-var">us2</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">UniqSupply -&gt; (UniqSupply, UniqSupply)
</span><a href="GHC.Types.Unique.Supply.html#splitUniqSupply"><span class="hs-identifier hs-var">splitUniqSupply</span></a></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><a href="#local-6989586621681190641"><span class="hs-identifier hs-var">us</span></a></span><span>
</span><span id="line-762"></span><span>
</span><span id="line-763"></span><span>        </span><span class="hs-comment">-- Remember the counts_so_far are reversed</span><span>
</span><span id="line-764"></span><span>        </span><span class="annot"><a href="#local-6989586621681190626"><span class="hs-identifier hs-type">totalise</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.Opt.Monad.html#SimplCount"><span class="hs-identifier hs-type">SimplCount</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#SimplCount"><span class="hs-identifier hs-type">SimplCount</span></a></span><span>
</span><span id="line-765"></span><span>        </span><span id="local-6989586621681190626"><span class="annot"><span class="annottext">totalise :: [SimplCount] -&gt; SimplCount
</span><a href="#local-6989586621681190626"><span class="hs-identifier hs-var hs-var">totalise</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(SimplCount -&gt; SimplCount -&gt; SimplCount)
-&gt; SimplCount -&gt; [SimplCount] -&gt; SimplCount
forall (t :: * -&gt; *) a b.
Foldable t =&gt;
(a -&gt; b -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldr"><span class="hs-identifier hs-var">foldr</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-glyph">\</span><span id="local-6989586621681190602"><span class="annot"><span class="annottext">SimplCount
</span><a href="#local-6989586621681190602"><span class="hs-identifier hs-var">c</span></a></span></span><span> </span><span id="local-6989586621681190601"><span class="annot"><span class="annottext">SimplCount
</span><a href="#local-6989586621681190601"><span class="hs-identifier hs-var">acc</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">SimplCount
</span><a href="#local-6989586621681190601"><span class="hs-identifier hs-var">acc</span></a></span><span> </span><span class="annot"><span class="annottext">SimplCount -&gt; SimplCount -&gt; SimplCount
</span><a href="GHC.Core.Opt.Monad.html#plusSimplCount"><span class="hs-operator hs-var">`plusSimplCount`</span></a></span><span> </span><span class="annot"><span class="annottext">SimplCount
</span><a href="#local-6989586621681190602"><span class="hs-identifier hs-var">c</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-766"></span><span>                         </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; SimplCount
</span><a href="GHC.Core.Opt.Monad.html#zeroSimplCount"><span class="hs-identifier hs-var">zeroSimplCount</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190650"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-767"></span><span>
</span><span id="line-768"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#simplifyPgmIO"><span class="hs-identifier hs-var">simplifyPgmIO</span></a></span><span> </span><span class="annot"><span class="annottext">CoreToDo
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">HscEnv
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">UniqSupply
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">RuleBase
</span><span class="hs-identifier">_</span></span><span> </span><span class="annot"><span class="annottext">ModGuts
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; IO (SimplCount, ModGuts)
forall a. String -&gt; a
</span><a href="GHC.Utils.Panic.Plain.html#panic"><span class="hs-identifier hs-var">panic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;simplifyPgmIO&quot;</span></span><span>
</span><span id="line-769"></span><span>
</span><span id="line-770"></span><span class="hs-comment">-------------------</span><span>
</span><span id="line-771"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#dump_end_iteration"><span class="hs-identifier hs-type">dump_end_iteration</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html#PrintUnqualified"><span class="hs-identifier hs-type">PrintUnqualified</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-772"></span><span>                   </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Monad.html#SimplCount"><span class="hs-identifier hs-type">SimplCount</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreRule"><span class="hs-identifier hs-type">CoreRule</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">IO</span></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-773"></span><span id="dump_end_iteration"><span class="annot"><span class="annottext">dump_end_iteration :: DynFlags
-&gt; PrintUnqualified
-&gt; Int
-&gt; SimplCount
-&gt; CoreProgram
-&gt; [CoreRule]
-&gt; IO ()
</span><a href="GHC.Core.Opt.Pipeline.html#dump_end_iteration"><span class="hs-identifier hs-var hs-var">dump_end_iteration</span></a></span></span><span> </span><span id="local-6989586621681190598"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190598"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681190597"><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621681190597"><span class="hs-identifier hs-var">print_unqual</span></a></span></span><span> </span><span id="local-6989586621681190596"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190596"><span class="hs-identifier hs-var">iteration_no</span></a></span></span><span> </span><span id="local-6989586621681190595"><span class="annot"><span class="annottext">SimplCount
</span><a href="#local-6989586621681190595"><span class="hs-identifier hs-var">counts</span></a></span></span><span> </span><span id="local-6989586621681190594"><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190594"><span class="hs-identifier hs-var">binds</span></a></span></span><span> </span><span id="local-6989586621681190593"><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681190593"><span class="hs-identifier hs-var">rules</span></a></span></span><span>
</span><span id="line-774"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags
-&gt; PrintUnqualified
-&gt; Maybe DumpFlag
-&gt; SDoc
-&gt; SDoc
-&gt; CoreProgram
-&gt; [CoreRule]
-&gt; IO ()
</span><a href="GHC.Core.Lint.html#dumpPassResult"><span class="hs-identifier hs-var">dumpPassResult</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190598"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">PrintUnqualified
</span><a href="#local-6989586621681190597"><span class="hs-identifier hs-var">print_unqual</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe DumpFlag
</span><a href="#local-6989586621681190592"><span class="hs-identifier hs-var">mb_flag</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681190591"><span class="hs-identifier hs-var">hdr</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681190590"><span class="hs-identifier hs-var">pp_counts</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190594"><span class="hs-identifier hs-var">binds</span></a></span><span> </span><span class="annot"><span class="annottext">[CoreRule]
</span><a href="#local-6989586621681190593"><span class="hs-identifier hs-var">rules</span></a></span><span>
</span><span id="line-775"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-776"></span><span>    </span><span id="local-6989586621681190592"><span class="annot"><span class="annottext">mb_flag :: Maybe DumpFlag
</span><a href="#local-6989586621681190592"><span class="hs-identifier hs-var hs-var">mb_flag</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DumpFlag -&gt; DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#dopt"><span class="hs-identifier hs-var">dopt</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_simpl_iterations"><span class="hs-identifier hs-var">Opt_D_dump_simpl_iterations</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681190598"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DumpFlag -&gt; Maybe DumpFlag
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">DumpFlag
</span><a href="GHC.Driver.Flags.html#Opt_D_dump_simpl_iterations"><span class="hs-identifier hs-var">Opt_D_dump_simpl_iterations</span></a></span><span>
</span><span id="line-777"></span><span>            </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                               </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Maybe DumpFlag
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-778"></span><span>            </span><span class="hs-comment">-- Show details if Opt_D_dump_simpl_iterations is on</span><span>
</span><span id="line-779"></span><span>
</span><span id="line-780"></span><span>    </span><span id="local-6989586621681190591"><span class="annot"><span class="annottext">hdr :: SDoc
</span><a href="#local-6989586621681190591"><span class="hs-identifier hs-var hs-var">hdr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;Simplifier iteration=&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%3E"><span class="hs-operator hs-var">&lt;&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#int"><span class="hs-identifier hs-var">int</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681190596"><span class="hs-identifier hs-var">iteration_no</span></a></span><span>
</span><span id="line-781"></span><span>    </span><span id="local-6989586621681190590"><span class="annot"><span class="annottext">pp_counts :: SDoc
</span><a href="#local-6989586621681190590"><span class="hs-identifier hs-var hs-var">pp_counts</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[SDoc] -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#vcat"><span class="hs-identifier hs-var">vcat</span></a></span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;---- Simplifier counts for&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681190591"><span class="hs-identifier hs-var">hdr</span></a></span><span>
</span><span id="line-782"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">SimplCount -&gt; SDoc
</span><a href="GHC.Core.Opt.Monad.html#pprSimplCount"><span class="hs-identifier hs-var">pprSimplCount</span></a></span><span> </span><span class="annot"><span class="annottext">SimplCount
</span><a href="#local-6989586621681190595"><span class="hs-identifier hs-var">counts</span></a></span><span>
</span><span id="line-783"></span><span>                     </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#text"><span class="hs-identifier hs-var">text</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;---- End of simplifier counts for&quot;</span></span><span> </span><span class="annot"><span class="annottext">SDoc -&gt; SDoc -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#%3C%2B%3E"><span class="hs-operator hs-var">&lt;+&gt;</span></a></span><span> </span><span class="annot"><span class="annottext">SDoc
</span><a href="#local-6989586621681190591"><span class="hs-identifier hs-var">hdr</span></a></span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-784"></span><span>
</span><span id="line-785"></span><span class="hs-comment">{-
************************************************************************
*                                                                      *
                Shorting out indirections
*                                                                      *
************************************************************************

If we have this:

        x_local = &lt;expression&gt;
        ...bindings...
        x_exported = x_local

where x_exported is exported, and x_local is not, then we replace it with this:

        x_exported = &lt;expression&gt;
        x_local = x_exported
        ...bindings...

Without this we never get rid of the x_exported = x_local thing.  This
save a gratuitous jump (from \tr{x_exported} to \tr{x_local}), and
makes strictness information propagate better.  This used to happen in
the final phase, but it's tidier to do it here.

Note [Messing up the exported Id's RULES]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We must be careful about discarding (obviously) or even merging the
RULES on the exported Id. The example that went bad on me at one stage
was this one:

    iterate :: (a -&gt; a) -&gt; a -&gt; [a]
        [Exported]
    iterate = iterateList

    iterateFB c f x = x `c` iterateFB c f (f x)
    iterateList f x =  x : iterateList f (f x)
        [Not exported]

    {-# RULES
    &quot;iterate&quot;   forall f x.     iterate f x = build (\c _n -&gt; iterateFB c f x)
    &quot;iterateFB&quot;                 iterateFB (:) = iterateList
     #-}

This got shorted out to:

    iterateList :: (a -&gt; a) -&gt; a -&gt; [a]
    iterateList = iterate

    iterateFB c f x = x `c` iterateFB c f (f x)
    iterate f x =  x : iterate f (f x)

    {-# RULES
    &quot;iterate&quot;   forall f x.     iterate f x = build (\c _n -&gt; iterateFB c f x)
    &quot;iterateFB&quot;                 iterateFB (:) = iterate
     #-}

And now we get an infinite loop in the rule system
        iterate f x -&gt; build (\cn -&gt; iterateFB c f x)
                    -&gt; iterateFB (:) f x
                    -&gt; iterate f x

Old &quot;solution&quot;:
        use rule switching-off pragmas to get rid
        of iterateList in the first place

But in principle the user *might* want rules that only apply to the Id
he says.  And inline pragmas are similar
   {-# NOINLINE f #-}
   f = local
   local = &lt;stuff&gt;
Then we do not want to get rid of the NOINLINE.

Hence hasShortableIdinfo.


Note [Rules and indirection-zapping]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Problem: what if x_exported has a RULE that mentions something in ...bindings...?
Then the things mentioned can be out of scope!  Solution
 a) Make sure that in this pass the usage-info from x_exported is
        available for ...bindings...
 b) If there are any such RULES, rec-ify the entire top-level.
    It'll get sorted out next time round

Other remarks
~~~~~~~~~~~~~
If more than one exported thing is equal to a local thing (i.e., the
local thing really is shared), then we do one only:
\begin{verbatim}
        x_local = ....
        x_exported1 = x_local
        x_exported2 = x_local
==&gt;
        x_exported1 = ....

        x_exported2 = x_exported1
\end{verbatim}

We rely on prior eta reduction to simplify things like
\begin{verbatim}
        x_exported = /\ tyvars -&gt; x_local tyvars
==&gt;
        x_exported = x_local
\end{verbatim}
Hence,there's a possibility of leaving unchanged something like this:
\begin{verbatim}
        x_local = ....
        x_exported1 = x_local Int
\end{verbatim}
By the time we've thrown away the types in STG land this
could be eliminated.  But I don't think it's very common
and it's dangerous to do this fiddling in STG land
because we might eliminate a binding that's mentioned in the
unfolding for something.

Note [Indirection zapping and ticks]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unfortunately this is another place where we need a special case for
ticks. The following happens quite regularly:

        x_local = &lt;expression&gt;
        x_exported = tick&lt;x&gt; x_local

Which we want to become:

        x_exported =  tick&lt;x&gt; &lt;expression&gt;

As it makes no sense to keep the tick and the expression on separate
bindings. Note however that this might increase the ticks scoping
over the execution of x_local, so we can only do this for floatable
ticks. More often than not, other references will be unfoldings of
x_exported, and therefore carry the tick anyway.
-}</span><span>
</span><span id="line-918"></span><span>
</span><span id="line-919"></span><span class="hs-keyword">type</span><span> </span><span id="IndEnv"><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#IndEnv"><span class="hs-identifier hs-var">IndEnv</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><a href="GHC.Types.Var.Env.html#IdEnv"><span class="hs-identifier hs-type">IdEnv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#Tickish"><span class="hs-identifier hs-type">Tickish</span></a></span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span class="hs-special">]</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- Maps local_id -&gt; exported_id, ticks</span><span>
</span><span id="line-920"></span><span>
</span><span id="line-921"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#shortOutIndirections"><span class="hs-identifier hs-type">shortOutIndirections</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreProgram"><span class="hs-identifier hs-type">CoreProgram</span></a></span><span>
</span><span id="line-922"></span><span id="shortOutIndirections"><span class="annot"><span class="annottext">shortOutIndirections :: CoreProgram -&gt; CoreProgram
</span><a href="GHC.Core.Opt.Pipeline.html#shortOutIndirections"><span class="hs-identifier hs-var hs-var">shortOutIndirections</span></a></span></span><span> </span><span id="local-6989586621681190584"><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190584"><span class="hs-identifier hs-var">binds</span></a></span></span><span>
</span><span id="line-923"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id]) -&gt; Bool
forall a. VarEnv a -&gt; Bool
</span><a href="GHC.Types.Var.Env.html#isEmptyVarEnv"><span class="hs-identifier hs-var">isEmptyVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190582"><span class="hs-identifier hs-var">ind_env</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190584"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-924"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681190581"><span class="hs-identifier hs-var">no_need_to_flatten</span></a></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190580"><span class="hs-identifier hs-var">binds'</span></a></span><span>                      </span><span class="hs-comment">-- See Note [Rules and indirect-zapping]</span><span>
</span><span id="line-925"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">[(Id, CoreExpr)] -&gt; Bind Id
forall b. [(b, Expr b)] -&gt; Bind b
</span><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-var">Rec</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CoreProgram -&gt; [(Id, CoreExpr)]
forall b. [Bind b] -&gt; [(b, Expr b)]
</span><a href="GHC.Core.html#flattenBinds"><span class="hs-identifier hs-var">flattenBinds</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190580"><span class="hs-identifier hs-var">binds'</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="hs-comment">-- for this no_need_to_flatten stuff</span><span>
</span><span id="line-926"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-927"></span><span>    </span><span id="local-6989586621681190582"><span class="annot"><span class="annottext">ind_env :: VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190582"><span class="hs-identifier hs-var hs-var">ind_env</span></a></span></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CoreProgram -&gt; VarEnv (Id, [Tickish Id])
</span><a href="GHC.Core.Opt.Pipeline.html#makeIndEnv"><span class="hs-identifier hs-var">makeIndEnv</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190584"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-928"></span><span>    </span><span class="hs-comment">-- These exported Ids are the subjects  of the indirection-elimination</span><span>
</span><span id="line-929"></span><span>    </span><span id="local-6989586621681190576"><span class="annot"><span class="annottext">exp_ids :: [Id]
</span><a href="#local-6989586621681190576"><span class="hs-identifier hs-var hs-var">exp_ids</span></a></span></span><span>            </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">((Id, [Tickish Id]) -&gt; Id) -&gt; [(Id, [Tickish Id])] -&gt; [Id]
forall a b. (a -&gt; b) -&gt; [a] -&gt; [b]
</span><a href="../../base/src/GHC.Base.html#map"><span class="hs-identifier hs-var">map</span></a></span><span> </span><span class="annot"><span class="annottext">(Id, [Tickish Id]) -&gt; Id
forall a b. (a, b) -&gt; a
</span><a href="../../base/src/Data.Tuple.html#fst"><span class="hs-identifier hs-var">fst</span></a></span><span> </span><span class="annot"><span class="annottext">([(Id, [Tickish Id])] -&gt; [Id]) -&gt; [(Id, [Tickish Id])] -&gt; [Id]
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id]) -&gt; [(Id, [Tickish Id])]
forall key elt. UniqFM key elt -&gt; [elt]
</span><a href="GHC.Types.Unique.FM.html#nonDetEltsUFM"><span class="hs-identifier hs-var">nonDetEltsUFM</span></a></span><span> </span><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190582"><span class="hs-identifier hs-var">ind_env</span></a></span><span>
</span><span id="line-930"></span><span>      </span><span class="hs-comment">-- It's OK to use nonDetEltsUFM here because we forget the ordering</span><span>
</span><span id="line-931"></span><span>      </span><span class="hs-comment">-- by immediately converting to a set or check if all the elements</span><span>
</span><span id="line-932"></span><span>      </span><span class="hs-comment">-- satisfy a predicate.</span><span>
</span><span id="line-933"></span><span>    </span><span id="local-6989586621681190574"><span class="annot"><span class="annottext">exp_id_set :: VarSet
</span><a href="#local-6989586621681190574"><span class="hs-identifier hs-var hs-var">exp_id_set</span></a></span></span><span>         </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">[Id] -&gt; VarSet
</span><a href="GHC.Types.Var.Set.html#mkVarSet"><span class="hs-identifier hs-var">mkVarSet</span></a></span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681190576"><span class="hs-identifier hs-var">exp_ids</span></a></span><span>
</span><span id="line-934"></span><span>    </span><span id="local-6989586621681190581"><span class="annot"><span class="annottext">no_need_to_flatten :: Bool
</span><a href="#local-6989586621681190581"><span class="hs-identifier hs-var hs-var">no_need_to_flatten</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Id -&gt; Bool) -&gt; [Id] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; (a -&gt; Bool) -&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#all"><span class="hs-identifier hs-var">all</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">[CoreRule] -&gt; Bool
forall (t :: * -&gt; *) a. Foldable t =&gt; t a -&gt; Bool
</span><a href="../../base/src/Data.Foldable.html#null"><span class="hs-identifier hs-var">null</span></a></span><span> </span><span class="annot"><span class="annottext">([CoreRule] -&gt; Bool) -&gt; (Id -&gt; [CoreRule]) -&gt; Id -&gt; Bool
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">RuleInfo -&gt; [CoreRule]
</span><a href="GHC.Types.Id.Info.html#ruleInfoRules"><span class="hs-identifier hs-var">ruleInfoRules</span></a></span><span> </span><span class="annot"><span class="annottext">(RuleInfo -&gt; [CoreRule]) -&gt; (Id -&gt; RuleInfo) -&gt; Id -&gt; [CoreRule]
forall b c a. (b -&gt; c) -&gt; (a -&gt; b) -&gt; a -&gt; c
</span><a href="../../base/src/GHC.Base.html#."><span class="hs-operator hs-var">.</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; RuleInfo
</span><a href="GHC.Types.Id.html#idSpecialisation"><span class="hs-identifier hs-var">idSpecialisation</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[Id]
</span><a href="#local-6989586621681190576"><span class="hs-identifier hs-var">exp_ids</span></a></span><span>
</span><span id="line-935"></span><span>    </span><span id="local-6989586621681190580"><span class="annot"><span class="annottext">binds' :: CoreProgram
</span><a href="#local-6989586621681190580"><span class="hs-identifier hs-var hs-var">binds'</span></a></span></span><span>             </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(Bind Id -&gt; CoreProgram) -&gt; CoreProgram -&gt; CoreProgram
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">Bind Id -&gt; CoreProgram
</span><a href="#local-6989586621681190564"><span class="hs-identifier hs-var">zap</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190584"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-936"></span><span>
</span><span id="line-937"></span><span>    </span><span id="local-6989586621681190564"><span class="annot"><span class="annottext">zap :: Bind Id -&gt; CoreProgram
</span><a href="#local-6989586621681190564"><span class="hs-identifier hs-var hs-var">zap</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-type">NonRec</span></a></span><span> </span><span id="local-6989586621681190561"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190561"><span class="hs-identifier hs-var">bndr</span></a></span></span><span> </span><span id="local-6989586621681190560"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190560"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">Id -&gt; CoreExpr -&gt; Bind Id
forall b. b -&gt; Expr b -&gt; Bind b
</span><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-var">NonRec</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190559"><span class="hs-identifier hs-var">b</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190558"><span class="hs-identifier hs-var">r</span></a></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681190559"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190559"><span class="hs-identifier hs-var">b</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681190558"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190558"><span class="hs-identifier hs-var">r</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Id, CoreExpr) -&gt; [(Id, CoreExpr)]
</span><a href="#local-6989586621681190557"><span class="hs-identifier hs-var">zapPair</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190561"><span class="hs-identifier hs-var">bndr</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190560"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-938"></span><span>    </span><span class="annot"><a href="#local-6989586621681190564"><span class="hs-identifier hs-var">zap</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-type">Rec</span></a></span><span> </span><span id="local-6989586621681190556"><span class="annot"><span class="annottext">[(Id, CoreExpr)]
</span><a href="#local-6989586621681190556"><span class="hs-identifier hs-var">pairs</span></a></span></span><span class="hs-special">)</span><span>       </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">[(Id, CoreExpr)] -&gt; Bind Id
forall b. [(b, Expr b)] -&gt; Bind b
</span><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-var">Rec</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">((Id, CoreExpr) -&gt; [(Id, CoreExpr)])
-&gt; [(Id, CoreExpr)] -&gt; [(Id, CoreExpr)]
forall (t :: * -&gt; *) a b. Foldable t =&gt; (a -&gt; [b]) -&gt; t a -&gt; [b]
</span><a href="../../base/src/Data.Foldable.html#concatMap"><span class="hs-identifier hs-var">concatMap</span></a></span><span> </span><span class="annot"><span class="annottext">(Id, CoreExpr) -&gt; [(Id, CoreExpr)]
</span><a href="#local-6989586621681190557"><span class="hs-identifier hs-var">zapPair</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, CoreExpr)]
</span><a href="#local-6989586621681190556"><span class="hs-identifier hs-var">pairs</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-939"></span><span>
</span><span id="line-940"></span><span>    </span><span id="local-6989586621681190557"><span class="annot"><span class="annottext">zapPair :: (Id, CoreExpr) -&gt; [(Id, CoreExpr)]
</span><a href="#local-6989586621681190557"><span class="hs-identifier hs-var hs-var">zapPair</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681190555"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190555"><span class="hs-identifier hs-var">bndr</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681190554"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190554"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-941"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190555"><span class="hs-identifier hs-var">bndr</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; VarSet -&gt; Bool
</span><a href="GHC.Types.Var.Set.html#elemVarSet"><span class="hs-operator hs-var">`elemVarSet`</span></a></span><span> </span><span class="annot"><span class="annottext">VarSet
</span><a href="#local-6989586621681190574"><span class="hs-identifier hs-var">exp_id_set</span></a></span><span>
</span><span id="line-942"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>   </span><span class="hs-comment">-- Kill the exported-id binding</span><span>
</span><span id="line-943"></span><span>
</span><span id="line-944"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681190552"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190552"><span class="hs-identifier hs-var">exp_id</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681190551"><span class="annot"><span class="annottext">[Tickish Id]
</span><a href="#local-6989586621681190551"><span class="hs-identifier hs-var">ticks</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id]) -&gt; Id -&gt; Maybe (Id, [Tickish Id])
forall a. VarEnv a -&gt; Id -&gt; Maybe a
</span><a href="GHC.Types.Var.Env.html#lookupVarEnv"><span class="hs-identifier hs-var">lookupVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190582"><span class="hs-identifier hs-var">ind_env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190555"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-945"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681190549"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190549"><span class="hs-identifier hs-var">exp_id'</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681190548"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190548"><span class="hs-identifier hs-var">lcl_id'</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Id -&gt; (Id, Id)
</span><a href="GHC.Core.Opt.Pipeline.html#transferIdInfo"><span class="hs-identifier hs-var">transferIdInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190552"><span class="hs-identifier hs-var">exp_id</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190555"><span class="hs-identifier hs-var">bndr</span></a></span><span>
</span><span id="line-946"></span><span>        </span><span class="hs-glyph">=</span><span>      </span><span class="hs-comment">-- Turn a local-id binding into two bindings</span><span>
</span><span id="line-947"></span><span>               </span><span class="hs-comment">--    exp_id = rhs; lcl_id = exp_id</span><span>
</span><span id="line-948"></span><span>          </span><span class="hs-special">[</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190549"><span class="hs-identifier hs-var">exp_id'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Tickish Id] -&gt; CoreExpr -&gt; CoreExpr
</span><a href="GHC.Core.Utils.html#mkTicks"><span class="hs-identifier hs-var">mkTicks</span></a></span><span> </span><span class="annot"><span class="annottext">[Tickish Id]
</span><a href="#local-6989586621681190551"><span class="hs-identifier hs-var">ticks</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190554"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-949"></span><span>            </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190548"><span class="hs-identifier hs-var">lcl_id'</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id -&gt; CoreExpr
forall b. Id -&gt; Expr b
</span><a href="GHC.Core.html#Var"><span class="hs-identifier hs-var">Var</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190549"><span class="hs-identifier hs-var">exp_id'</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">]</span><span>
</span><span id="line-950"></span><span>
</span><span id="line-951"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>
</span><span id="line-952"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190555"><span class="hs-identifier hs-var">bndr</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190554"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-953"></span><span>
</span><span id="line-954"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#makeIndEnv"><span class="hs-identifier hs-type">makeIndEnv</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span class="hs-special">]</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#IndEnv"><span class="hs-identifier hs-type">IndEnv</span></a></span><span>
</span><span id="line-955"></span><span id="makeIndEnv"><span class="annot"><span class="annottext">makeIndEnv :: CoreProgram -&gt; VarEnv (Id, [Tickish Id])
</span><a href="GHC.Core.Opt.Pipeline.html#makeIndEnv"><span class="hs-identifier hs-var hs-var">makeIndEnv</span></a></span></span><span> </span><span id="local-6989586621681190544"><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190544"><span class="hs-identifier hs-var">binds</span></a></span></span><span>
</span><span id="line-956"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(VarEnv (Id, [Tickish Id]) -&gt; Bind Id -&gt; VarEnv (Id, [Tickish Id]))
-&gt; VarEnv (Id, [Tickish Id])
-&gt; CoreProgram
-&gt; VarEnv (Id, [Tickish Id])
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id]) -&gt; Bind Id -&gt; VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190542"><span class="hs-identifier hs-var">add_bind</span></a></span><span> </span><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id])
forall a. VarEnv a
</span><a href="GHC.Types.Var.Env.html#emptyVarEnv"><span class="hs-identifier hs-var">emptyVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">CoreProgram
</span><a href="#local-6989586621681190544"><span class="hs-identifier hs-var">binds</span></a></span><span>
</span><span id="line-957"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-958"></span><span>    </span><span class="annot"><a href="#local-6989586621681190542"><span class="hs-identifier hs-type">add_bind</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#IndEnv"><span class="hs-identifier hs-type">IndEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.html#CoreBind"><span class="hs-identifier hs-type">CoreBind</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#IndEnv"><span class="hs-identifier hs-type">IndEnv</span></a></span><span>
</span><span id="line-959"></span><span>    </span><span id="local-6989586621681190542"><span class="annot"><span class="annottext">add_bind :: VarEnv (Id, [Tickish Id]) -&gt; Bind Id -&gt; VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190542"><span class="hs-identifier hs-var hs-var">add_bind</span></a></span></span><span> </span><span id="local-6989586621681190540"><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190540"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#NonRec"><span class="hs-identifier hs-type">NonRec</span></a></span><span> </span><span id="local-6989586621681190539"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190539"><span class="hs-identifier hs-var">exported_id</span></a></span></span><span> </span><span id="local-6989586621681190538"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190538"><span class="hs-identifier hs-var">rhs</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id])
-&gt; (Id, CoreExpr) -&gt; VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190537"><span class="hs-identifier hs-var">add_pair</span></a></span><span> </span><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190540"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190539"><span class="hs-identifier hs-var">exported_id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190538"><span class="hs-identifier hs-var">rhs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-960"></span><span>    </span><span class="annot"><a href="#local-6989586621681190542"><span class="hs-identifier hs-var">add_bind</span></a></span><span> </span><span id="local-6989586621681190536"><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190536"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Core.html#Rec"><span class="hs-identifier hs-type">Rec</span></a></span><span> </span><span id="local-6989586621681190535"><span class="annot"><span class="annottext">[(Id, CoreExpr)]
</span><a href="#local-6989586621681190535"><span class="hs-identifier hs-var">pairs</span></a></span></span><span class="hs-special">)</span><span>              </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">(VarEnv (Id, [Tickish Id])
 -&gt; (Id, CoreExpr) -&gt; VarEnv (Id, [Tickish Id]))
-&gt; VarEnv (Id, [Tickish Id])
-&gt; [(Id, CoreExpr)]
-&gt; VarEnv (Id, [Tickish Id])
forall (t :: * -&gt; *) b a.
Foldable t =&gt;
(b -&gt; a -&gt; b) -&gt; b -&gt; t a -&gt; b
</span><a href="../../base/src/Data.Foldable.html#foldl%27"><span class="hs-identifier hs-var">foldl'</span></a></span><span> </span><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id])
-&gt; (Id, CoreExpr) -&gt; VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190537"><span class="hs-identifier hs-var">add_pair</span></a></span><span> </span><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190536"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">[(Id, CoreExpr)]
</span><a href="#local-6989586621681190535"><span class="hs-identifier hs-var">pairs</span></a></span><span>
</span><span id="line-961"></span><span>
</span><span id="line-962"></span><span>    </span><span class="annot"><a href="#local-6989586621681190537"><span class="hs-identifier hs-type">add_pair</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#IndEnv"><span class="hs-identifier hs-type">IndEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span class="annot"><a href="GHC.Core.html#CoreExpr"><span class="hs-identifier hs-type">CoreExpr</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#IndEnv"><span class="hs-identifier hs-type">IndEnv</span></a></span><span>
</span><span id="line-963"></span><span>    </span><span id="local-6989586621681190537"><span class="annot"><span class="annottext">add_pair :: VarEnv (Id, [Tickish Id])
-&gt; (Id, CoreExpr) -&gt; VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190537"><span class="hs-identifier hs-var hs-var">add_pair</span></a></span></span><span> </span><span id="local-6989586621681190534"><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190534"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681190533"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190533"><span class="hs-identifier hs-var">exported_id</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681190532"><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190532"><span class="hs-identifier hs-var">exported</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-964"></span><span>        </span><span class="hs-glyph">|</span><span> </span><span class="hs-special">(</span><span id="local-6989586621681190531"><span class="annot"><span class="annottext">[Tickish Id]
</span><a href="#local-6989586621681190531"><span class="hs-identifier hs-var">ticks</span></a></span></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Core.html#Var"><span class="hs-identifier hs-type">Var</span></a></span><span> </span><span id="local-6989586621681190530"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190530"><span class="hs-identifier hs-var">local_id</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">(Tickish Id -&gt; Bool) -&gt; CoreExpr -&gt; ([Tickish Id], CoreExpr)
forall b. (Tickish Id -&gt; Bool) -&gt; Expr b -&gt; ([Tickish Id], Expr b)
</span><a href="GHC.Core.Utils.html#stripTicksTop"><span class="hs-identifier hs-var">stripTicksTop</span></a></span><span> </span><span class="annot"><span class="annottext">Tickish Id -&gt; Bool
forall id. Tickish id -&gt; Bool
</span><a href="GHC.Core.html#tickishFloatable"><span class="hs-identifier hs-var">tickishFloatable</span></a></span><span> </span><span class="annot"><span class="annottext">CoreExpr
</span><a href="#local-6989586621681190532"><span class="hs-identifier hs-var">exported</span></a></span><span>
</span><span id="line-965"></span><span>        </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id]) -&gt; Id -&gt; Id -&gt; Bool
</span><a href="GHC.Core.Opt.Pipeline.html#shortMeOut"><span class="hs-identifier hs-var">shortMeOut</span></a></span><span> </span><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190534"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190533"><span class="hs-identifier hs-var">exported_id</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190530"><span class="hs-identifier hs-var">local_id</span></a></span><span>
</span><span id="line-966"></span><span>        </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id])
-&gt; Id -&gt; (Id, [Tickish Id]) -&gt; VarEnv (Id, [Tickish Id])
forall a. VarEnv a -&gt; Id -&gt; a -&gt; VarEnv a
</span><a href="GHC.Types.Var.Env.html#extendVarEnv"><span class="hs-identifier hs-var">extendVarEnv</span></a></span><span> </span><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190534"><span class="hs-identifier hs-var">env</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190530"><span class="hs-identifier hs-var">local_id</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190533"><span class="hs-identifier hs-var">exported_id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">[Tickish Id]
</span><a href="#local-6989586621681190531"><span class="hs-identifier hs-var">ticks</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-967"></span><span>    </span><span class="annot"><a href="#local-6989586621681190537"><span class="hs-identifier hs-var">add_pair</span></a></span><span> </span><span id="local-6989586621681190526"><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190526"><span class="hs-identifier hs-var">env</span></a></span></span><span> </span><span class="annot"><span class="annottext">(Id, CoreExpr)
</span><span class="hs-identifier">_</span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190526"><span class="hs-identifier hs-var">env</span></a></span><span>
</span><span id="line-968"></span><span>
</span><span id="line-969"></span><span class="hs-comment">-----------------</span><span>
</span><span id="line-970"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#shortMeOut"><span class="hs-identifier hs-type">shortMeOut</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#IndEnv"><span class="hs-identifier hs-type">IndEnv</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-971"></span><span id="shortMeOut"><span class="annot"><span class="annottext">shortMeOut :: VarEnv (Id, [Tickish Id]) -&gt; Id -&gt; Id -&gt; Bool
</span><a href="GHC.Core.Opt.Pipeline.html#shortMeOut"><span class="hs-identifier hs-var hs-var">shortMeOut</span></a></span></span><span> </span><span id="local-6989586621681190525"><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190525"><span class="hs-identifier hs-var">ind_env</span></a></span></span><span> </span><span id="local-6989586621681190524"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190524"><span class="hs-identifier hs-var">exported_id</span></a></span></span><span> </span><span id="local-6989586621681190523"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190523"><span class="hs-identifier hs-var">local_id</span></a></span></span><span>
</span><span id="line-972"></span><span class="hs-comment">-- The if-then-else stuff is just so I can get a pprTrace to see</span><span>
</span><span id="line-973"></span><span class="hs-comment">-- how often I don't get shorting out because of IdInfo stuff</span><span>
</span><span id="line-974"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Var.html#isExportedId"><span class="hs-identifier hs-var">isExportedId</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190524"><span class="hs-identifier hs-var">exported_id</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span>              </span><span class="hs-comment">-- Only if this is exported</span><span>
</span><span id="line-975"></span><span>
</span><span id="line-976"></span><span>       </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Var.html#isLocalId"><span class="hs-identifier hs-var">isLocalId</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190523"><span class="hs-identifier hs-var">local_id</span></a></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span>                    </span><span class="hs-comment">-- Only if this one is defined in this</span><span>
</span><span id="line-977"></span><span>                                                </span><span class="hs-comment">--      module, so that we *can* change its</span><span>
</span><span id="line-978"></span><span>                                                </span><span class="hs-comment">--      binding to be the exported thing!</span><span>
</span><span id="line-979"></span><span>
</span><span id="line-980"></span><span>       </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Types.Var.html#isExportedId"><span class="hs-identifier hs-var">isExportedId</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190523"><span class="hs-identifier hs-var">local_id</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span>           </span><span class="hs-comment">-- Only if this one is not itself exported,</span><span>
</span><span id="line-981"></span><span>                                                </span><span class="hs-comment">--      since the transformation will nuke it</span><span>
</span><span id="line-982"></span><span>
</span><span id="line-983"></span><span>       </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190523"><span class="hs-identifier hs-var">local_id</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; VarEnv (Id, [Tickish Id]) -&gt; Bool
forall a. Id -&gt; VarEnv a -&gt; Bool
</span><a href="GHC.Types.Var.Env.html#elemVarEnv"><span class="hs-operator hs-var">`elemVarEnv`</span></a></span><span> </span><span class="annot"><span class="annottext">VarEnv (Id, [Tickish Id])
</span><a href="#local-6989586621681190525"><span class="hs-identifier hs-var">ind_env</span></a></span><span class="hs-special">)</span><span>      </span><span class="hs-comment">-- Only if not already substituted for</span><span>
</span><span id="line-984"></span><span>    </span><span class="hs-keyword">then</span><span>
</span><span id="line-985"></span><span>        </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Id -&gt; Bool
</span><a href="GHC.Core.Opt.Pipeline.html#hasShortableIdInfo"><span class="hs-identifier hs-var">hasShortableIdInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190524"><span class="hs-identifier hs-var">exported_id</span></a></span><span>
</span><span id="line-986"></span><span>        </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">True</span></span><span>       </span><span class="hs-comment">-- See Note [Messing up the exported Id's IdInfo]</span><span>
</span><span id="line-987"></span><span>        </span><span class="hs-keyword">else</span><span> </span><span class="hs-identifier">WARN</span><span class="hs-special">(</span><span> </span><span class="hs-identifier">True</span><span class="hs-special">,</span><span> </span><span class="hs-identifier">text</span><span> </span><span class="hs-string">&quot;Not shorting out:&quot;</span><span> </span><span class="hs-operator">&lt;+&gt;</span><span> </span><span class="hs-identifier">ppr</span><span> </span><span class="hs-identifier">exported_id</span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-988"></span><span>             </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-989"></span><span>    </span><span class="hs-keyword">else</span><span>
</span><span id="line-990"></span><span>        </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-991"></span><span>
</span><span id="line-992"></span><span class="hs-comment">-----------------</span><span>
</span><span id="line-993"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#hasShortableIdInfo"><span class="hs-identifier hs-type">hasShortableIdInfo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span>
</span><span id="line-994"></span><span class="hs-comment">-- True if there is no user-attached IdInfo on exported_id,</span><span>
</span><span id="line-995"></span><span class="hs-comment">-- so we can safely discard it</span><span>
</span><span id="line-996"></span><span class="hs-comment">-- See Note [Messing up the exported Id's IdInfo]</span><span>
</span><span id="line-997"></span><span id="hasShortableIdInfo"><span class="annot"><span class="annottext">hasShortableIdInfo :: Id -&gt; Bool
</span><a href="GHC.Core.Opt.Pipeline.html#hasShortableIdInfo"><span class="hs-identifier hs-var hs-var">hasShortableIdInfo</span></a></span></span><span> </span><span id="local-6989586621681190517"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190517"><span class="hs-identifier hs-var">id</span></a></span></span><span>
</span><span id="line-998"></span><span>  </span><span class="hs-glyph">=</span><span>  </span><span class="annot"><span class="annottext">RuleInfo -&gt; Bool
</span><a href="GHC.Types.Id.Info.html#isEmptyRuleInfo"><span class="hs-identifier hs-var">isEmptyRuleInfo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IdInfo -&gt; RuleInfo
</span><a href="GHC.Types.Id.Info.html#ruleInfo"><span class="hs-identifier hs-var hs-var">ruleInfo</span></a></span><span> </span><span class="annot"><span class="annottext">IdInfo
</span><a href="#local-6989586621681190514"><span class="hs-identifier hs-var">info</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-999"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">InlinePragma -&gt; Bool
</span><a href="GHC.Types.Basic.html#isDefaultInlinePragma"><span class="hs-identifier hs-var">isDefaultInlinePragma</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IdInfo -&gt; InlinePragma
</span><a href="GHC.Types.Id.Info.html#inlinePragInfo"><span class="hs-identifier hs-var hs-var">inlinePragInfo</span></a></span><span> </span><span class="annot"><span class="annottext">IdInfo
</span><a href="#local-6989586621681190514"><span class="hs-identifier hs-var">info</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1000"></span><span>  </span><span class="annot"><span class="annottext">Bool -&gt; Bool -&gt; Bool
</span><span class="hs-operator hs-var">&amp;&amp;</span></span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Unfolding -&gt; Bool
</span><a href="GHC.Core.html#isStableUnfolding"><span class="hs-identifier hs-var">isStableUnfolding</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IdInfo -&gt; Unfolding
</span><a href="GHC.Types.Id.Info.html#unfoldingInfo"><span class="hs-identifier hs-var hs-var">unfoldingInfo</span></a></span><span> </span><span class="annot"><span class="annottext">IdInfo
</span><a href="#local-6989586621681190514"><span class="hs-identifier hs-var">info</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-1001"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1002"></span><span>     </span><span id="local-6989586621681190514"><span class="annot"><span class="annottext">info :: IdInfo
</span><a href="#local-6989586621681190514"><span class="hs-identifier hs-var hs-var">info</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Id -&gt; IdInfo
Id -&gt; IdInfo
</span><a href="GHC.Types.Var.html#idInfo"><span class="hs-identifier hs-var">idInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190517"><span class="hs-identifier hs-var">id</span></a></span><span>
</span><span id="line-1003"></span><span>
</span><span id="line-1004"></span><span class="hs-comment">-----------------</span><span>
</span><span id="line-1005"></span><span class="hs-comment">{- Note [Transferring IdInfo]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If we have
     lcl_id = e; exp_id = lcl_id

and lcl_id has useful IdInfo, we don't want to discard it by going
     gbl_id = e; lcl_id = gbl_id

Instead, transfer IdInfo from lcl_id to exp_id, specifically
* (Stable) unfolding
* Strictness
* Rules
* Inline pragma

Overwriting, rather than merging, seems to work ok.

We also zap the InlinePragma on the lcl_id. It might originally
have had a NOINLINE, which we have now transferred; and we really
want the lcl_id to inline now that its RHS is trivial!
-}</span><span>
</span><span id="line-1025"></span><span>
</span><span id="line-1026"></span><span class="annot"><a href="GHC.Core.Opt.Pipeline.html#transferIdInfo"><span class="hs-identifier hs-type">transferIdInfo</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">(</span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.Types.Var.html#Id"><span class="hs-identifier hs-type">Id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1027"></span><span class="hs-comment">-- See Note [Transferring IdInfo]</span><span>
</span><span id="line-1028"></span><span id="transferIdInfo"><span class="annot"><span class="annottext">transferIdInfo :: Id -&gt; Id -&gt; (Id, Id)
</span><a href="GHC.Core.Opt.Pipeline.html#transferIdInfo"><span class="hs-identifier hs-var hs-var">transferIdInfo</span></a></span></span><span> </span><span id="local-6989586621681190507"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190507"><span class="hs-identifier hs-var">exported_id</span></a></span></span><span> </span><span id="local-6989586621681190506"><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190506"><span class="hs-identifier hs-var">local_id</span></a></span></span><span>
</span><span id="line-1029"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">(</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; (IdInfo -&gt; IdInfo) -&gt; Id -&gt; Id
(IdInfo -&gt; IdInfo) -&gt; Id -&gt; Id
</span><a href="GHC.Types.Id.html#modifyIdInfo"><span class="hs-identifier hs-var">modifyIdInfo</span></a></span><span> </span><span class="annot"><span class="annottext">IdInfo -&gt; IdInfo
</span><a href="#local-6989586621681190504"><span class="hs-identifier hs-var">transfer</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190507"><span class="hs-identifier hs-var">exported_id</span></a></span><span>
</span><span id="line-1030"></span><span>    </span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190506"><span class="hs-identifier hs-var">local_id</span></a></span><span> </span><span class="annot"><span class="annottext">Id -&gt; InlinePragma -&gt; Id
</span><a href="GHC.Types.Id.html#setInlinePragma"><span class="hs-operator hs-var">`setInlinePragma`</span></a></span><span> </span><span class="annot"><span class="annottext">InlinePragma
</span><a href="GHC.Types.Basic.html#defaultInlinePragma"><span class="hs-identifier hs-var">defaultInlinePragma</span></a></span><span> </span><span class="hs-special">)</span><span>
</span><span id="line-1031"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-1032"></span><span>    </span><span id="local-6989586621681190500"><span class="annot"><span class="annottext">local_info :: IdInfo
</span><a href="#local-6989586621681190500"><span class="hs-identifier hs-var hs-var">local_info</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">HasDebugCallStack =&gt; Id -&gt; IdInfo
Id -&gt; IdInfo
</span><a href="GHC.Types.Var.html#idInfo"><span class="hs-identifier hs-var">idInfo</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190506"><span class="hs-identifier hs-var">local_id</span></a></span><span>
</span><span id="line-1033"></span><span>    </span><span id="local-6989586621681190504"><span class="annot"><span class="annottext">transfer :: IdInfo -&gt; IdInfo
</span><a href="#local-6989586621681190504"><span class="hs-identifier hs-var hs-var">transfer</span></a></span></span><span> </span><span id="local-6989586621681190499"><span class="annot"><span class="annottext">IdInfo
</span><a href="#local-6989586621681190499"><span class="hs-identifier hs-var">exp_info</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">IdInfo
</span><a href="#local-6989586621681190499"><span class="hs-identifier hs-var">exp_info</span></a></span><span> </span><span class="annot"><span class="annottext">IdInfo -&gt; StrictSig -&gt; IdInfo
</span><a href="GHC.Types.Id.Info.html#setStrictnessInfo"><span class="hs-operator hs-var">`setStrictnessInfo`</span></a></span><span>    </span><span class="annot"><span class="annottext">IdInfo -&gt; StrictSig
</span><a href="GHC.Types.Id.Info.html#strictnessInfo"><span class="hs-identifier hs-var hs-var">strictnessInfo</span></a></span><span> </span><span class="annot"><span class="annottext">IdInfo
</span><a href="#local-6989586621681190500"><span class="hs-identifier hs-var">local_info</span></a></span><span>
</span><span id="line-1034"></span><span>                                 </span><span class="annot"><span class="annottext">IdInfo -&gt; CprSig -&gt; IdInfo
</span><a href="GHC.Types.Id.Info.html#setCprInfo"><span class="hs-operator hs-var">`setCprInfo`</span></a></span><span>           </span><span class="annot"><span class="annottext">IdInfo -&gt; CprSig
</span><a href="GHC.Types.Id.Info.html#cprInfo"><span class="hs-identifier hs-var hs-var">cprInfo</span></a></span><span> </span><span class="annot"><span class="annottext">IdInfo
</span><a href="#local-6989586621681190500"><span class="hs-identifier hs-var">local_info</span></a></span><span>
</span><span id="line-1035"></span><span>                                 </span><span class="annot"><span class="annottext">IdInfo -&gt; Unfolding -&gt; IdInfo
</span><a href="GHC.Types.Id.Info.html#setUnfoldingInfo"><span class="hs-operator hs-var">`setUnfoldingInfo`</span></a></span><span>     </span><span class="annot"><span class="annottext">IdInfo -&gt; Unfolding
</span><a href="GHC.Types.Id.Info.html#unfoldingInfo"><span class="hs-identifier hs-var hs-var">unfoldingInfo</span></a></span><span> </span><span class="annot"><span class="annottext">IdInfo
</span><a href="#local-6989586621681190500"><span class="hs-identifier hs-var">local_info</span></a></span><span>
</span><span id="line-1036"></span><span>                                 </span><span class="annot"><span class="annottext">IdInfo -&gt; InlinePragma -&gt; IdInfo
</span><a href="GHC.Types.Id.Info.html#setInlinePragInfo"><span class="hs-operator hs-var">`setInlinePragInfo`</span></a></span><span>    </span><span class="annot"><span class="annottext">IdInfo -&gt; InlinePragma
</span><a href="GHC.Types.Id.Info.html#inlinePragInfo"><span class="hs-identifier hs-var hs-var">inlinePragInfo</span></a></span><span> </span><span class="annot"><span class="annottext">IdInfo
</span><a href="#local-6989586621681190500"><span class="hs-identifier hs-var">local_info</span></a></span><span>
</span><span id="line-1037"></span><span>                                 </span><span class="annot"><span class="annottext">IdInfo -&gt; RuleInfo -&gt; IdInfo
</span><a href="GHC.Types.Id.Info.html#setRuleInfo"><span class="hs-operator hs-var">`setRuleInfo`</span></a></span><span>          </span><span class="annot"><span class="annottext">RuleInfo -&gt; RuleInfo -&gt; RuleInfo
</span><a href="GHC.Core.Rules.html#addRuleInfo"><span class="hs-identifier hs-var">addRuleInfo</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IdInfo -&gt; RuleInfo
</span><a href="GHC.Types.Id.Info.html#ruleInfo"><span class="hs-identifier hs-var hs-var">ruleInfo</span></a></span><span> </span><span class="annot"><span class="annottext">IdInfo
</span><a href="#local-6989586621681190499"><span class="hs-identifier hs-var">exp_info</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">RuleInfo
</span><a href="#local-6989586621681190491"><span class="hs-identifier hs-var">new_info</span></a></span><span>
</span><span id="line-1038"></span><span>    </span><span id="local-6989586621681190491"><span class="annot"><span class="annottext">new_info :: RuleInfo
</span><a href="#local-6989586621681190491"><span class="hs-identifier hs-var hs-var">new_info</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Name -&gt; RuleInfo -&gt; RuleInfo
</span><a href="GHC.Types.Id.Info.html#setRuleInfoHead"><span class="hs-identifier hs-var">setRuleInfoHead</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Id -&gt; Name
</span><a href="GHC.Types.Id.html#idName"><span class="hs-identifier hs-var">idName</span></a></span><span> </span><span class="annot"><span class="annottext">Id
</span><a href="#local-6989586621681190507"><span class="hs-identifier hs-var">exported_id</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1039"></span><span>                               </span><span class="hs-special">(</span><span class="annot"><span class="annottext">IdInfo -&gt; RuleInfo
</span><a href="GHC.Types.Id.Info.html#ruleInfo"><span class="hs-identifier hs-var hs-var">ruleInfo</span></a></span><span> </span><span class="annot"><span class="annottext">IdInfo
</span><a href="#local-6989586621681190500"><span class="hs-identifier hs-var">local_info</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-1040"></span><span>        </span><span class="hs-comment">-- Remember to set the function-name field of the</span><span>
</span><span id="line-1041"></span><span>        </span><span class="hs-comment">-- rules as we transfer them from one function to another</span><span>
</span><span id="line-1042"></span></pre></body></html>